Forum Discussion

ChineduE's avatar
ChineduE
Copper Contributor
May 25, 2023
Solved

How to make all the items that occur on a particular date appear in another worksheet

Hello all,   I'm trying to analyze sales data for my company and I need to be able to populate all sales that occured on a particular date in another worksheet.   The basic idea is to have Sheet ...
  • NikolinoDE's avatar
    May 25, 2023

    ChineduE 

    Here is how you can do it, using the FILTER function:

    1. In Sheet 2, enter the desired date in cell B1.
    2. In cell A3, enter the following formula to retrieve the filtered sales data from Sheet 1:

    =FILTER(Sheet1!$A$2:$D$12, Sheet1!$A$2:$A$12 = B1)

    Replace Sheet1!$A$2:$D$12 with the actual range of your sales data in Sheet 1.

         3. Press Enter to get the filtered sales data. The formula will display the sales records from Sheet 1 that match the date entered in cell B1.

         4. Adjust the range references in the formula as needed to match your actual data range in Sheet 1.

    Now, whenever you change the date in cell B1, the sales data in Sheet 2 will automatically update based on the new date. Note that this method requires the data in Sheet 1 to be sorted by date in ascending order for accurate results.

     

    Another approach is to use the Power Query feature

    To populate all the sales data that occurred on a particular date in another worksheet in Excel 365, you can use the Power Query feature. Here's how you can do it:

    1. Select the range of your sales data in Sheet 1 (including the headers).
    2. Go to the "Data" tab in the Excel ribbon and click on "From Table/Range" in the "Get & Transform Data" section. This will open the Power Query Editor.
    3. In the Power Query Editor, ensure that the column headers are correct. If needed, you can rename them by selecting the column header and clicking on "Transform" -> "Rename".
    4. Close the Power Query Editor by clicking on the "Close & Load" button in the "Home" tab. This will load the data into a new table.
    5. Go to Sheet 2 and select the cell where you want the date input to be entered (in this example, B1).
    6. In the Excel ribbon, go to the "Data" tab and click on "Get Data" -> "From Table/Range" in the "Get & Transform Data" section. This will open the Power Query Editor again.
    7. In the Power Query Editor, click on the date cell (B1) in the first row to select it.
    8. Right-click on the selected cell and choose "Drill Down". This will extract the selected date value.
    9. Close the Power Query Editor by clicking on the "Close & Load" button in the "Home" tab. This will load the extracted date value into a new table.
    10. Select the cell where you want the filtered data to start (in this example, A3).
    11. In the Excel ribbon, go to the "Data" tab and click on "From Table/Range" in the "Get & Transform Data" section. This will open the Power Query Editor again.
    12. In the Power Query Editor, click on the "Date" column header to select it.
    13. Go to the "Home" tab in the Power Query Editor and click on the "Filter Rows" button in the "Transform" section. This will open the filter options.
    14. In the filter options, choose the desired date from the list or enter the desired date manually.
    15. Close the Power Query Editor by clicking on the "Close & Load" button in the "Home" tab. This will load the filtered data into the selected cell.

     

    Now, the Sheet 2 table will display only the sales data that occurred on the selected date. Whenever you change the date in cell B1, you can right-click on the table in Sheet 2 and choose "Refresh" to update the data based on the new date. These steps were created with the help of AI.

Resources