Lookup reference formula

jrabi

Board Regular
Joined
Aug 20, 2010
Messages
143
I have a file with 4 sheets.

Each sheet has 2 columns, column A is the source code, column b is the source name.

I want to place a formula in sheet 1 column C to see if any of the same source codes are on sheets 2,3 or 4.

So I want to look at the source code on sheet 1 column A and see if this source code is on any of the 3 sheets, if it is, then I would like to return a value of "match" or "no match"

Any help would be appreciated, thanks.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
In C2 try;
=IF(SUM(COUNTIF(INDIRECT({"Sheet2";"Sheet3";"Sheet4"}&"!A:A"),A2)),"match","no match")

Change sheet names to suit....
 
Upvote 0
I am getting a #REF!

=IF(SUM(COUNTIF(INDIRECT({"compare 1";"compare 2";"compare 3"}&"!A:A"),A2)),"match","no match")

I have excel 2007.
 
Upvote 0
Hi

If a worksheet name has spaces you have to enclose it in single quotes.

Try:

=IF(SUM(COUNTIF(INDIRECT("'"&{"compare 1";"compare 2";"compare 3"}&"'!A:A"),A2)),"match","no match")
 
Upvote 0
I am getting a #REF!

=IF(SUM(COUNTIF(INDIRECT({"compare 1";"compare 2";"compare 3"}&"!A:A"),A2)),"match","no match")

I have excel 2007.
Try it like this...

=IF(SUM(COUNTIF(INDIRECT("'Compare "&{1,2,3}&"'!A:A"),A2)),"Match","No Match")

Note that the sheets Compare 1, Compare 2 and Compare 3 must exist or you'll get an error.
 
Upvote 0
That was it, I was just getting ready to change the name back to sheet1, sheet2, another good tip to know so I am glad I got your response, thanks to all.
 
Upvote 0
Ok, I have a slight mod, what if on the sheet with the formula I insert a column at C so the formula resides in D. A is the source code, B is the source name.

I want to add to the formula if in Column C it is a 4, then check only the sheets that are "compare 1", "compare 2", "compare 3" and "4".

In column C for the 4 which means its a 4 door, I would enter a 4 for every source code. Or it may be a 5, 6, etc.

Is there a way to add to the formula look at column c and if it matches any other sheet check for a match?
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,261
Members
452,901
Latest member
LisaGo

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