Forum Discussion

Scales1270's avatar
Scales1270
Copper Contributor
Oct 07, 2023

Finding the Difference in workbooks.

I have to track resources on reports I pull every day, twice daily. These resources may move from one incident to another and the original date they started I need to track and carry it over to the new incident.  I cross reference row by row from the previous day to the current day and from the morning report to the afternoon report looking for who came, left, or just moved from one incident to another.  I am stumped on the best x-look, x-match, x-index to use.  Also, the data is in two separate workbooks. Please any suggestion would be greatly appreciated. 

2 Replies

  • To track changes in resources between two separate workbooks in Excel, you can use a combination of functions like `VLOOKUP`, `INDEX`, and `MATCH`, or you can utilize Excel's Power Query functionality. 

     

    This is 1 of the alternate which you can try. Assuming you have Workbook A (previous day's report) and Workbook B (current day's report):

     

    1. Open Workbook A and Workbook B in Excel.

    2. In Workbook B, create a new column (let's say it's in Column C) where you want to track changes (e.g., "Status"). In this column, you can use formulas to find differences between the two workbooks.

    3. To check if a resource from Workbook B exists in Workbook A, you can use the `VLOOKUP` function. In cell C2 of Workbook B (assuming the resource names are in Column A of both workbooks), enter the following formula:

    ```excel
    =IF(ISNUMBER(VLOOKUP(A2, 'Workbook A'!A:A, 1, FALSE)), "No Change", "New Resource")
    ```

    This formula checks if the value in cell A2 of Workbook B exists in Workbook A. If it does, it marks it as "No Change," otherwise, it marks it as "New Resource."

    4. To track resources that have moved from one incident to another, you can add another column (e.g., "Incident Change") in Workbook B. In cell D2 of Workbook B, enter the following formula:

    ```excel
    =IF(ISNUMBER(MATCH(A2, 'Workbook A'!A:A, 0)), "No Change", "Moved")
    ```

    This formula checks if the resource in cell A2 of Workbook B is also found in Workbook A. If it is, it marks it as "No Change," otherwise, it marks it as "Moved."

    5. After applying these formulas to the relevant columns in Workbook B, you can visually identify which resources are new, which have moved, and which haven't changed based on the values in the "Status" and "Incident Change" columns.

     

    Kindly adjust cell references and workbook names to match your actual data and workbook structure.

     

    Alternatively, you can explore Excel's Power Query functionality to combine and compare data from multiple workbooks, which can provide a more automated and flexible solution for tracking changes between the reports. 

     

    Scales1270 

     

    Please consider giving it a 'thumbs up' if the response was helpful for you. (external links removed by moderator)

  • NikolinoDE's avatar
    NikolinoDE
    Gold Contributor

    Scales1270 

    To track resources that move from one incident to another and carry over the original start date to the new incident in two separate workbooks, you can use Excel's lookup and comparison functions. You can achieve this by using functions like VLOOKUP, INDEX, MATCH, and IFERROR.

    Assuming you have two workbooks: "MorningReport.xlsx" and "AfternoonReport.xlsx," and both workbooks have similar structures with columns for resource names, incidents, and start dates, here is a general approach to track resource movements:

    1. Open both workbooks in Excel.
    2. Create a new worksheet in one of the workbooks (e.g., "Tracking").
    3. In the "Tracking" worksheet, you can start by creating a list of unique resource names. Assuming your resource names are in Column A of both workbooks, enter this formula in cell A1 of the "Tracking" worksheet and drag it down to create the list:

    =UNIQUE('MorningReport.xlsx'!A:A)

    This formula extracts unique resource names from the morning report.

    1. In the adjacent column (e.g., column B), you can use the following formula to track the original start date for each resource:

    This formula searches for the resource name in the morning report and retrieves the start date. If the resource is not found in the morning report, it leaves the cell blank.

    1. In another column (e.g., column C), you can track the current incident for each resource using a formula like this:

    =IFERROR(VLOOKUP(A1, 'AfternoonReport.xlsx'!A:B, 2, FALSE), "")

    This formula searches for the resource name in the afternoon report and retrieves the current incident. If the resource is not found in the afternoon report, it leaves the cell blank.

    1. Finally, in another column (e.g., column D), you can track the original start date for the resource's current incident:

    =IF(C1<>"", IFERROR(INDEX('MorningReport.xlsx'!C:C, MATCH(A1, 'MorningReport.xlsx'!A:A, 0)), ""), "")

    This formula checks if the current incident is not blank (i.e., the resource is present in the afternoon report). If yes, it looks up the original start date for that incident in the morning report.

    Now, you have a "Tracking" worksheet that lists each resource, their original start date, current incident, and the original start date for their current incident. This will help you track resource movements between incidents.

    Remember to adjust the sheet names and column references according to your actual workbook structure. All the formulas are untested. The text and steps were edited with the help of AI.

     

    My answers are voluntary and without guarantee!

     

    Hope this will help you.

    Was the answer useful? Mark as best response and Like it!

    This will help all forum participants.

Resources