VLOOKUP FUNCTION?

jpalleyne

New Member
Joined
Dec 12, 2019
Messages
24
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
I need a formula to return the ref # from table #2 so I have the ref # in table #1. I'd need the formula to be based on date and and amount as those would be the only unique identifiers given that the numbers have the potential to repeat themselves, that's where the date criteria would come in but there's still a chance that the same number will be present on that particular date. I was trying VLOOKUP/MATCH with no luck.
Any help would be appreciated.
Table #1
Date​
Details​
Amount​
Ref #​
01/03/2023​
Digital- SOUTH COAST DENTmed i​
2,368.26​
?
Table #2
Date​
Details​
Amount​
Ref #​
01/03/2023​
Wire Transfer
2,368.26​
12614​
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hello

Excel Formula:
=XLOOKUP([@Date]&[@Amount],table2[Date]&table2[Amount],table2[Ref '#])'

If Ref # is always a number you can use SUMFIFS().
Excel Formula:
=SUMIFS(table2[Ref '#];table2[Date];[@Date];table2[Amount];[@Amount])'
 
Upvote 0
but there's still a chance that the same number will be present on that particular date.
Not quite sure what that means so if the previous post does not fully answer your question, please post some larger sample data (say 15-20 rows) and the expected results with XL2BB and explain again in relation to that larger sample data
 
Upvote 0
Thanks - I should have put some more data. Here's how the info looks:

Table #1
DateDetailsAmountRef #
01/03/2023
Digital- SOUTH COAST DENTmed i
2,368.26?
01/03/2023Insurance300.00?
01/03/2023Insurance300.00?
01/04/2023Insurance6,989.30?
01/04/2023Insurance200.00?
01/04/2023Insurance200.00?

Table #2
DateDetailsAmountRef #
01/03/2023
Wire Transfer
2,368.2612614
01/03/2023
Wire Transfer
300.0012614
01/03/2023
Wire Transfer
300.0012614
01/04/2023
Wire Transfer
6,989.3012615
01/04/2023
Wire Transfer
200.0012615
01/04/2023
Wire Transfer
200.0012615

So the ref # repeats in table #2 and the date will be the same for a couple lines and the numbers will be the same or different.

The SUMIFS is adding ref #s together for the amounts that repeat as is expected. I hope this helps!
 
Upvote 0
XLOOKUP is returning an error. Can you send what the formula for XLOOKUP should look like with the new data set showing the multiple lines, I may be doing it wrong.
 
Upvote 0
Not quite sure what that means so if the previous post does not fully answer your question, please post some larger sample data (say 15-20 rows) and the expected results with XL2BB and explain again in relation to that larger sample data
I posted some more data - please take a look.
 
Upvote 0
XLOOKUP is returning an error.
I had missed that the XLOOKUP formula in post 2 contains a stray single quote mark (') at the end.

Can you send what the formula for XLOOKUP should look like with the new data set showing the multiple lines,
The formula structure proposed (even with the extra ' removed) is somewhat problematic to me as it could lead to false results as shown in the first mini sheet below.

NB: When posting sample data, please consider XL2BB rather than how you have done it in posts 1 & 4 with all those extra borders and no column/row labels etc.

jpalleyne.xlsm
ABCD
2
3DateDetailsAmountRef #
41/03/2023Digital- SOUTH COAST DENTmed i2,368.2612614
51/03/2023Insurance30012614
61/03/2023Insurance30012614
71/04/2023Insurance6,989.3012615
81/04/2023Insurance20012615
91/04/2023Insurance20012615
1024/04/1912xx1144
11
12
13DateDetailsAmountRef #
141/03/2023Wire Transfer2,368.2612614
151/03/2023Wire Transfer30012614
161/03/2023Wire Transfer30012614
171/04/2023Wire Transfer6,989.3012615
181/04/2023Wire Transfer20012615
191/04/2023Wire Transfer20012615
2024/02/2023xx144
21
Sheet1
Cell Formulas
RangeFormula
D4:D10D4=XLOOKUP([@Date]&[@Amount],Table2[Date]&Table2[Amount],Table2[Ref '#])


To overcome the possible incorrect results like above, I would modify the formula like this

jpalleyne.xlsm
ABCD
2
3DateDetailsAmountRef #
41/03/2023Digital- SOUTH COAST DENTmed i2,368.2612614
51/03/2023Insurance30012614
61/03/2023Insurance30012614
71/04/2023Insurance6,989.3012615
81/04/2023Insurance20012615
91/04/2023Insurance20012615
1024/04/1912xx11#N/A
11
12
13DateDetailsAmountRef #
141/03/2023Wire Transfer2,368.2612614
151/03/2023Wire Transfer30012614
161/03/2023Wire Transfer30012614
171/04/2023Wire Transfer6,989.3012615
181/04/2023Wire Transfer20012615
191/04/2023Wire Transfer20012615
2024/02/2023xx144
21
Sheet1
Cell Formulas
RangeFormula
D4:D10D4=XLOOKUP([@Date]&"|"&[@Amount],Table2[Date]&"|"&Table2[Amount],Table2[Ref '#])
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,263
Messages
6,123,956
Members
449,135
Latest member
jcschafer209

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