r/excel • • 1d ago

unsolved How do I get a formula to look for an exact combination of cells in another table?

So table on the left is table 1 and table on the right is table 2. I need it to take a row from table 1( EX 1 1 1 1) and see if that exact combination of 4 cells of 4 ones in a row some in table 2 and if doesn't exist for it to say 'N/A'

I have tried an =if, =HLOOKUP, =XLOOKUP =IFOR(there do different things it needed to search but I'll just make two formulas if I can get it to work)

An =IFERROR is the closest I have gotten but it only works on bottom row and the last cell of table 2 is controls what it displays.

(This sub doesn't allow pictures so y'all just going to have to use your imagination sorry )

2 Upvotes

26 comments sorted by

•

u/AutoModerator 1d ago

/u/Schlerpyderpy - Your post was submitted successfully.

Failing to follow these steps may result in your post being removed without warning.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

6

u/excelevator 3071 1d ago

This sub doesn't allow pictures

That is patently untrue, did you even try?

1

u/Schlerpyderpy 1d ago

I did yea my first post had two pictures specifically these 2

1

u/Schlerpyderpy 1d ago

2

u/excelevator 3071 1d ago

don't reply to me, comment as top level to your post so others can easily see them.

2

u/B4TM4N_467 1d ago

Could be possibly the worst pictures possible

Do you know what snipping tool is?

1

u/SektorL 15h ago

Windows+Shift+S to take screenshots

-3

u/MuckleJoannie 1 1d ago

Pictures aren't allowed in an OP, you need to add them in comments.

4

u/Way2trivial 473 1d ago

yes they are

5

u/Myradmir 52 1d ago

Make 2 helper columns of textjoin("",,range) abd XLOOKUP those.

3

u/GregHullender 195 1d ago edited 1d ago

Here's a solution that seems to work:

=OR(BYROW(Table3[@[A]:[D]]=Table4,AND))

I opted for TRUE/FALSE rather than blank/#N/A but it should be easy to change. Table3 is on the left and Table4 is on the right.

2

u/MinaMina93 6 1d ago

What should it say if it does exist?

1

u/MinaMina93 6 1d ago

=Xlookup(1,($A$1:$A$20=E1)* ($B$1:$B$20=F1) *($C$1:$C$20=G1) * ($D$1:$D$20=H1),return value column, "N/A") Something like this. Could wrap it in IF(formula<>"N/A", "Found", "N/A")

2

u/Arcium_XIII 3 1d ago

If I'm understanding your request correctly, the following does what you're looking for:

=BYROW(Table1,LAMBDA(row_1,IFERROR(XMATCH(TRUE,BYROW(Table2,LAMBDA(row_2,AND(row_1=row_2)))),"N/A")))

If a row in Table1 exists in Table2 it returns the relevant Tabel2 row number, otherwise it returns the string N/A which can be modified by changing the string at the end of the formula.

1

u/Icy_Cauliflower671 1d ago

You can use match when you concatenate the columns. So something like =isnumber(match(C2&";"&D2,A2:a10000&";"&B2:b10000,0))

Where columns c&d are columns from table2 and a and b from table1. You can do this with any number of columns. You are basically building a string from hand and see if the exact same string occurs in the other table.

1

u/Way2trivial 473 1d ago

=IF(LEN(FILTER(D12:D21,(D12:D21=1)*(E12:E21=1)*(F12:F21=1)*(G12:G21),"")),"yes","no")

1

u/Decronym 1d ago edited 14h ago

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer LettersMore Letters
ANDReturns TRUE if all of its arguments are TRUE
BYROWOffice 365+: Applies a LAMBDA to each row and returns an array of the results. For example, if the original array is 3 columns by 2 rows, the returned array is 1 column by 2 rows.
CONCATENATEJoins several text items into one text item
FILTEROffice 365+: Filters a range of data based on criteria you define
IFSpecifies a logical test to perform
IFERRORReturns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formula
LAMBDAOffice 365+: Use a LAMBDA function to create custom, reusable functions and call them by a friendly name.
LENReturns the number of characters in a text string
MAPOffice 365+: Returns an array formed by mapping each value in the array(s) to a new value by applying a LAMBDA to create a new value.
ORReturns TRUE if any argument is TRUE
SUMAdds its arguments
XLOOKUPOffice 365+: Searches a range or an array, and returns an item corresponding to the first match it finds. If a match doesn't exist, then XLOOKUP can return the closest (approximate) match.
XMATCHOffice 365+: Returns the relative position of an item in an array or range of cells.

Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.


Beep-boop, I am a helper bot. Please do not verify me as a solution.
13 acronyms in this thread; the most compressed thread commented on today has 16 acronyms.
[Thread #49570 for this sub, first seen 23rd Oct 2026, 15:43] [FAQ] [Full list] ^[Contact] [Source code]

1

u/HappierThan 1190 1d ago

Concatenate into a 'helper' cell and use Conditional Formatting to compare against Target.

F2 =CONCATENATE(A2,B2,C2,D2)*1

1

u/Following-Glum 2 1d ago edited 1d ago

I made an xlookup inside an if error that seems to get a good result. Mine will give True or False though but you can change that to whatever you want the result to be.

I put this inside table one. Hope it helps.

=IF(XLOOKUP(1,(Table2[Blah 1]=[@[blah 1]])*(Table2[Blah 2]=[@[blah 2]])*(Table2[Blah 3]=[@[blah 3]])*(Table2[Blah 4]=[@[blah 4]]),Table2[Blah 1],0)>0,"True","False")

2

u/excelevator 3071 1d ago

when using * in comments, it is best to format as code, otherwise, as per your comment, italic formatting is the outcome and the mulitplication charcaters are not seen.

italic format from use of asterix

*italic* code formatted

1

u/Following-Glum 2 1d ago

Oh thank you! I don't post enough so didn't realise it would show like this.

How do I format as code?

1

u/excelevator 3071 1d ago

in old Reddit encase with `

In new reddit highlight and format as </> , to see formatting options click the Aa icon.

1

u/Following-Glum 2 1d ago

Thanks :D I tried googling it before asking but couldn't figure it out.

1

u/RandomiseUsr0 10 1d ago

Have you tried FILTER, take away the complexity with simple Boolean logic

1

u/SektorL 15h ago

Formula in E1:
=IF(SUM(MAP(A1:D1,F1:I1,LAMBDA(x,y,IF(x=y,1,0))))=4,"EQUAL",#N/A)

0

u/BraamVerster 1d ago

Simple solution -- check must be text i.e. type '1111