SOLVED

Comparing a cell value against a table

%3CLINGO-SUB%20id%3D%22lingo-sub-1508312%22%20slang%3D%22en-US%22%3EComparing%20a%20cell%20value%20against%20a%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1508312%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20I'm%20looking%20for%202%20formulas%20to%20compare%20a%20value%20against%20a%20table%20in%20excel%20to%20return%201)%20a%20match%20and%202)%20another%20value.%3C%2FP%3E%3CP%3EBelow%20is%20an%20example%20of%20the%20excel%20table.%3C%2FP%3E%3CP%3EWhat%20should%20be%20the%20input%20formulas%20in%20the%20yellow%20highlighted%20field%20for%20expected%20result%3F%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22gab2020_0-1594200386116.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204059iC92F995B6E316D42%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22gab2020_0-1594200386116.png%22%20alt%3D%22gab2020_0-1594200386116.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1508312%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1508572%22%20slang%3D%22en-US%22%3ERe%3A%20Comparing%20a%20cell%20value%20against%20a%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1508572%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F722079%22%20target%3D%22_blank%22%3E%40gab2020%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20the%20layout%20of%20the%20data%20is%20similar%20to%20as%20per%20the%20screenshot%20below...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22CheckValueInTable.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204081iD77864763B76E72D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22CheckValueInTable.jpg%22%20alt%3D%22CheckValueInTable.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EYou%20may%20try%20these%20formulas%20to%20get%20the%20desired%20outputs...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20B8%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DIF(COUNTIF(C2%3AH5%2CA8)%2C%22True%22%2C%22False%22)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20B9%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DINDEX(B2%3AB5%2CAGGREGATE(15%2C6%2C1%2F(C2%3AH5%3DA9)*(ROW(C2%3AH5)-ROW(C2)%2B1)%2C1))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20refer%20to%20the%20attached%20for%20more%20details.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1509366%22%20slang%3D%22en-US%22%3ERe%3A%20Comparing%20a%20cell%20value%20against%20a%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1509366%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F722079%22%20target%3D%22_blank%22%3E%40gab2020%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDuplication%20of%26nbsp%3B%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexcel%2Fcomparing-a-value-against-a-table-for-match%2Fm-p%2F1508276%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexcel%2Fcomparing-a-value-against-a-table-for-match%2Fm-p%2F1508276%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1510539%22%20slang%3D%22en-US%22%3ERe%3A%20Comparing%20a%20cell%20value%20against%20a%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1510539%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394231%22%20target%3D%22_blank%22%3E%40Subodh_Tiwari_sktneer%3C%2FA%3E%26nbsp%3Bfor%20the%20details.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENoted%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E.%3C%2FP%3E%3CP%3E%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1510756%22%20slang%3D%22en-US%22%3ERe%3A%20Comparing%20a%20cell%20value%20against%20a%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1510756%22%20slang%3D%22en-US%22%3E%3CP%3EYou're%20welcome%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F722079%22%20target%3D%22_blank%22%3E%40gab2020%3C%2FA%3E!%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi, I'm looking for 2 formulas to compare a value against a table in excel to return 1) a match and 2) another value.

Below is an example of the excel table.

What should be the input formulas in the yellow highlighted field for expected result?

Thanks.

gab2020_0-1594200386116.png

 

4 Replies
Best Response confirmed by gab2020 (New Contributor)
Solution

@gab2020 

If the layout of the data is similar to as per the screenshot below...

 

CheckValueInTable.jpg

You may try these formulas to get the desired outputs...

 

In B8

 

=IF(COUNTIF(C2:H5,A8),"True","False")

 

 

In B9

 

=INDEX(B2:B5,AGGREGATE(15,6,1/(C2:H5=A9)*(ROW(C2:H5)-ROW(C2)+1),1))

 

 

Please refer to the attached for more details.

 

Thanks @Subodh_Tiwari_sktneer for the details.

 

Noted @Sergei Baklan.

You're welcome @gab2020!