Complex lookup formula for simple Data Validation

HScott22

New Member
Joined
Oct 29, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am comparing 2 files for direct deposit data validation. I want to compare that the files match (All columns and rows).

The files are basic. But here lies the problem...some employees have multiple lines of direct deposit accounts and it only looks at their first line and then populates the compare with only the first line.

Picture attached:
I have a compare file with the ORIGINAL data and Vlookup <<<(=VLOOKUP(A2,Ceridian!A:A,1,0)>>> pulls the data to compare into the same sheet. Then there is a simple = formula to show any difference.
 

Attachments

  • Mr.Excel Vlookup.jpg
    Mr.Excel Vlookup.jpg
    214.5 KB · Views: 9

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Welcome to the MrExcel forum!

I believe I got the gist of your query, although I had trouble with some of the details. I think the overall idea is that if there are multiple rows with the same EMP ID in it, then the nth instance of that EMP ID should return the nth instance from the lookup table?

If so, consider these sheets:

Book2
ABCDEFGH
1Emp IDFirst NameLast NameDeposit NumberPay MethodFinancial InstitutionRouting NumberAccount Number
210004JohnSmith1CheckingJPMORGAN CHASE BANK, N.A.123456789111222333
310004JohnSmith2Savings1JPMORGAN CHASE BANK, N.A.123456789111222444
410004JohnSmith3Savings2JPMORGAN CHASE BANK, N.A.123456789111222555
5
Original


Book2
ABCDEFGHIJKLMNOPQRSTUVWX
1Emp IDLOOKUPMatch?First NameLOOKUPMatch?Last NameLOOKUPMatch?Deposit NumberLOOKUPMatch?Pay MethodLOOKUPMatch?Financial InstitutionLOOKUPMatch?Routing NumberLOOKUPMatch?Account NumberLOOKUPMatch?
21000410004TRUEJohnJohnTRUESmithSmithTRUE11TRUECheckingCheckingTRUEJPMORGAN CHASE BANK, N.A.JPMORGAN CHASE BANK, N.A.TRUE123456789123456789TRUE111222333111222333TRUE
31000410004TRUEJohnJohnTRUESmithSmithTRUE12FALSESavings1Savings1TRUEJPMORGAN CHASE BANK, N.A.JPMORGAN CHASE BANK, N.A.TRUE123456789123456789TRUE111222444111222444TRUE
41000410004TRUEJohnJohnTRUESmithSmithTRUE13FALSESavings2Savings2TRUEJPMORGAN CHASE BANK, N.A.JPMORGAN CHASE BANK, N.A.TRUE123456789123456789TRUE111222555111222555TRUE
Comparison
Cell Formulas
RangeFormula
B2:B4B2=INDEX(FILTER(Original!$A$2:$A$1000,Original!$A$2:$A$1000=A2,"No match"),COUNTIFS(A$2:A2,A2))
C2:C4,X2:X4,U2:U4,R2:R4,O2:O4,L2:L4,I2:I4,F2:F4C2=A2=B2
E2:E4,W2:W4,T2:T4,Q2:Q4,N2:N4,K2:K4,H2:H4E2=LET(v,INDEX(Original!$A$2:$H$1000,0,MATCH(D$1,Original!$A$1:$H$1,0)),f,FILTER(v,Original!$A$2:$A$1000=$A2),INDEX(f,COUNTIFS($A$2:$A2,$A2)))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:X4Expression=A1=FALSEtextNO


To make the formula simpler, I made the headings on both sheets match. If that's a problem, you can hard code the column number in the each formula.

Also, as an FYI, look into the xl2bb add-in (see the link in the reply box). It allows you to display your data in a way that lets the helpers here copy it, and not have to retype everything from a picture. You're likely to get faster results if you use it.

Anyway, let us know if this works for you.
 
Upvote 0
You sir are a life saver!

It has worked AMAZING for my first several columns of data, but not my last 4 even when I tried to edit the formula. Its still showing N/A (my edits are below).

I am crossing my fingers to learn as much about this formula as I can to use in other data validations.

1. Columns need to have the same title
2. what else should I note?


**I am not able to use the xl2bb add in. I am on my work computer. I will actually try to use my personal and load that for any further posts.


My Formula Edits:
For each formula I edited the column it was looking at (See RED below)
Account #:
=LET(v,INDEX(Original!$A$2:$H$1000,0,MATCH(V$1,Original!$A$1:$H$1,0)),f,FILTER(v,Original!$A$2:$A$1000=$A2),INDEX(f,COUNTIFS($A$2:$A2,$A2)))


Deposit Value:
=LET(v,INDEX(Original!$A$2:$H$1000,0,MATCH(Y$1,Original!$A$1:$H$1,0)),f,FILTER(v,Original!$A$2:$A$1000=$A2),INDEX(f,COUNTIFS($A$2:$A2,$A2)))

Deposit Type
=LET(v,INDEX(Original!$A$2:$H$1000,0,MATCH(AB$1,Original!$A$1:$H$1,0)),f,FILTER(v,Original!$A$2:$A$1000=$A2),INDEX(f,COUNTIFS($A$2:$A2,$A2)))


Requires Pre Note:
=LET(v,INDEX(Original!$A$2:$H$1000,0,MATCH(AE$1,Original!$A$1:$H$1,0)),f,FILTER(v,Original!$A$2:$A$1000=$A2),INDEX(f,COUNTIFS($A$2:$A2,$A2)))
 

Attachments

  • Mr.Excel2.jpg
    Mr.Excel2.jpg
    229.2 KB · Views: 4
Upvote 0
Change the green H in all the formulas below to L. The ranges in the formulas must match the full table in the Original sheet, which stretches to L. If you still have trouble, double check that the headings match exactly, no extra spaces.
Account #:
=LET(v,INDEX(Original!$A$2:$H$1000,0,MATCH(V$1,Original!$A$1:$H$1,0)),f,FILTER(v,Original!$A$2:$A$1000=$A2),INDEX(f,COUNTIFS($A$2:$A2,$A2)))
Deposit Value:
=LET(v,INDEX(Original!$A$2:$H$1000,0,MATCH(Y$1,Original!$A$1:$H$1,0)),f,FILTER(v,Original!$A$2:$A$1000=$A2),INDEX(f,COUNTIFS($A$2:$A2,$A2)))
Deposit Type
=LET(v,INDEX(Original!$A$2:$H$1000,0,MATCH(AB$1,Original!$A$1:$H$1,0)),f,FILTER(v,Original!$A$2:$A$1000=$A2),INDEX(f,COUNTIFS($A$2:$A2,$A2)))
Requires Pre Note:
=LET(v,INDEX(Original!$A$2:$H$1000,0,MATCH(AE$1,Original!$A$1:$H$1,0)),f,FILTER(v,Original!$A$2:$A$1000=$A2),INDEX(f,COUNTIFS($A$2:$A2,$A2)))
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,112
Members
453,021
Latest member
Justyna P

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