XLookup or Match/Index? Unsure which to use

Redd_Dayspring

New Member
Joined
May 24, 2023
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Good evening. I have been struggling with this, I'm not sure if I'm on the right track.
I have two workbooks - workbook 2 has accrual amounts by date and employee ID that I need to populate into workbook 1.
Is there a way to match the week ending dates (C) and employee ID's (E) from workbook 1 to the damage dates (A) and employee ID's (B) from workbook 2 and place the corresponding accrual amount into workbook 1 column G.
I've highlighted where they should go and the correct amount in yellow.

Everything I've come up with has either resulted in an error or the incorrect amount.
Any help, direction, or resources on where to learn how to figure this out would be greatly appreciated.
Unfortunately, due to security settings, I can only attach a picture vs the mini sheet.
Thank you in advance.
 

Attachments

  • Workbook 1.png
    Workbook 1.png
    82.9 KB · Views: 14
  • Workbook 2.png
    Workbook 2.png
    55.3 KB · Views: 13

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I can only attach a picture vs the mini sheet.
Another option is to copy/paste directly from your worksheet to the forum and tell us the range. It is not as good as XL2BB but at least we can copy from it.

I know my dates are not realistic but see if this helps.

Workbook 2.xlsx
ABF
1Damage DateEmployee IDAccrual Amount
25/01/20231234561
325/01/20239876542
414/02/20231234563
56/03/20231234564
626/03/20231234565
715/04/20231234566
85/05/20231234567
925/05/20231234568
1014/06/20231234569
Sheet1


Workbook 1.xlsx
CEG
1Week EndingEmployee IDAccrual Amount
27/01/2023123456 
314/02/20231234563
423/02/2023123456 
516/03/2023123456 
625/01/2023123456 
715/04/20231234566
85/05/20231234567
925/01/20239876542
1015/02/2023987654 
Sheet1
Cell Formulas
RangeFormula
G2:G10G2=FILTER('[Workbook 2.xlsx]Sheet1'!F$2:F$100,('[Workbook 2.xlsx]Sheet1'!A$2:A$100=C2)*('[Workbook 2.xlsx]Sheet1'!B$2:B$100=E2),"")
 
Upvote 0
So many missing pieces.
• In Workbook 1 you have the same dates repeating for the same employee ID, how is the formula to know which of the repeating dates to return a value to.
• I assume the return value of $ 947.17 is an error since that is from the Invoice column not the Accrual column
• In Workbook 2 all the values are left aligned, does that mean they are all being read as Text by Excel instead of dates and numbers ?
(If you are not sure change the number format, if nothing appears to change it is text, this will change how the formula needs to work)
• Since workbook 1 is in weeks I assume you could return more than one value which needs to be totalled.

Here is a variation of @Peter_SSs's formula catering for some of those.
I tried it on a closed workbook and it appears to work (SumIfs did not)

Excel Formula:
=LET(fltr,FILTER('[Workbook 2.xlsx]Sheet1'!F$2:F$101,('[Workbook 2.xlsx]Sheet1'!A$2:A$101<=C2)*('[Workbook 2.xlsx]Sheet1'!A$2:A$101>(C2-7))*('[Workbook 2.xlsx]Sheet1'!B$2:B$101=E2),0),IF(SUM(fltr)=0,"",SUM(fltr)))
 
Upvote 0
My apologies - I'm trying to find a way to upload a model of what I am working with while redacting sensitive information and not being able to use XL2BB and post as a mini sheet. I honestly appreciate the help and direction. I'm trying both posted solutions.
 
Upvote 0

Forum statistics

Threads
1,215,130
Messages
6,123,220
Members
449,091
Latest member
jeremy_bp001

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top