Vlookup

ekhawaja

Board Regular
Joined
Dec 16, 2018
Messages
60
Office Version
  1. 365
Hello,

Looking for a formula that looks for an item in sheet 2, the tag name is repeated in sheet 2, and want the formula to return "yes" only if all the corresponding Status is "yes". If a "no" or "blank" or a combination of "yes", "no", "blank" exists, the formula should return "No".
Thanks in advance!
Sheet 1Sheet 2
TagStatusTagStatus
applenopeachyes
orangeyespeachno
peachnoappleyes
orangeyes
peachyes
peachyes
orangeyes
orangeyes
apple
apple
appleyes
appleno
 
this formula is working now, error was that some of the cells had "extra space" in them which resulted in the error. I had to manually delete the "spaces" then the formula worked perfectly!!
I wanted to know if there is a possibility of extending this formula to check among 3 sheets, so Sheet 1 is where the formula will be, and it will check across Sheet 2,3,4 for the result.

Right now i am individually running the formula for each sheet.

Thanks in advance
 
Upvote 0

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
you are welcome
not sure if you read this:

I wanted to know if there is a possibility of extending this formula to check among 3 sheets, so Sheet 1 is where the formula will be, and it will check across Sheet 2,3,4 for the result.

Right now i am individually running the formula for each sheet.

Thanks in advance
 
Upvote 0
ok,
so we need to lookup and see if the value exists in sheet2 - like we did with pear

=IF(COUNTIF(Sheet2!A2:A13,Sheet1!A2)=0,"error",IF(COUNTIF(Sheet2!$A$2:$A$13,Sheet1!A2)=COUNTIFS(Sheet2!$A$2:$A$13,Sheet1!A2,Sheet2!$B$2:$B$13,"yes"),"Yes","no"))

so instead of error , you know what to lookup and see if it is sheet 3 and if not sheet4

will the value ONLY appear in 1 sheet at any time
 
Upvote 0
ok,
so we need to lookup and see if the value exists in sheet2 - like we did with pear

=IF(COUNTIF(Sheet2!A2:A13,Sheet1!A2)=0,"error",IF(COUNTIF(Sheet2!$A$2:$A$13,Sheet1!A2)=COUNTIFS(Sheet2!$A$2:$A$13,Sheet1!A2,Sheet2!$B$2:$B$13,"yes"),"Yes","no"))

so instead of error , you know what to lookup and see if it is sheet 3 and if not sheet4

will the value ONLY appear in 1 sheet at any time
Thank you.

There is no reference to sheet 3 or sheet 4 in the formula though?
 
Upvote 0
There is no reference to sheet 3 or sheet 4 in the formula though?
No,
i'm trying to understand what you are after

hence question
will the value ONLY appear in 1 sheet at any time
perhaps an example of the the additional sheets and results expected

as i posted - using xl2bb and a sample with expected rsults
 
Upvote 0
No,
i'm trying to understand what you are after

hence question

perhaps an example of the the additional sheets and results expected

as i posted - using xl2bb and a sample with expected rsults
correct, the lookup value should exist only in one of the sheets (only by mistake it would end up in multiple).
 
Upvote 0
does this work for you
will only work for values that appear in 1 sheet

=IF(COUNTIF(Sheet2!$A$2:$A$13,Sheet1!A2)>0,IF(COUNTIF(Sheet2!$A$2:$A$13,Sheet1!A2)=COUNTIFS(Sheet2!$A$2:$A$13,Sheet1!A2,Sheet2!$B$2:$B$13,"yes"),"Yes","no"),
IF(COUNTIF(Sheet3!$A$2:$A$13,Sheet1!A2)>0,IF(COUNTIF(Sheet3!$A$2:$A$13,Sheet1!A2)=COUNTIFS(Sheet3!$A$2:$A$13,Sheet1!A2,Sheet3!$B$2:$B$13,"yes"),"Yes","no"),
IF(COUNTIF(Sheet4!$A$2:$A$13,Sheet1!A2)>0,IF(COUNTIF(Sheet4!$A$2:$A$13,Sheet1!A2)=COUNTIFS(Sheet4!$A$2:$A$13,Sheet1!A2,Sheet4!$B$2:$B$13,"yes"),"Yes","no"),"error")))

Book6
ABC
1TagStatusmultisheet
2applenono
3orangeyesYes
4peachnoYes
5fredYes
6johnerror
7error
Sheet1
Cell Formulas
RangeFormula
C2:C7C2=IF(COUNTIF(Sheet2!$A$2:$A$13,Sheet1!A2)>0,IF(COUNTIF(Sheet2!$A$2:$A$13,Sheet1!A2)=COUNTIFS(Sheet2!$A$2:$A$13,Sheet1!A2,Sheet2!$B$2:$B$13,"yes"),"Yes","no"), IF(COUNTIF(Sheet3!$A$2:$A$13,Sheet1!A2)>0,IF(COUNTIF(Sheet3!$A$2:$A$13,Sheet1!A2)=COUNTIFS(Sheet3!$A$2:$A$13,Sheet1!A2,Sheet3!$B$2:$B$13,"yes"),"Yes","no"), IF(COUNTIF(Sheet4!$A$2:$A$13,Sheet1!A2)>0,IF(COUNTIF(Sheet4!$A$2:$A$13,Sheet1!A2)=COUNTIFS(Sheet4!$A$2:$A$13,Sheet1!A2,Sheet4!$B$2:$B$13,"yes"),"Yes","no"),"error")))


Book6
AB
1TagStatus
2peachyes
3
4
5
6
7
8orangeyes
9orangeyes
10apple
11apple
12appleyes
13appleno
Sheet2


Book6
AB
1peachno
2appleyes
3orangeyes
4peachno
5peachyes
Sheet3


Book6
AB
1
2fredyes
3fredyes
4
Sheet4


i only keep on dropbox for a few days
 
Upvote 0

Forum statistics

Threads
1,216,051
Messages
6,128,503
Members
449,455
Latest member
jesski

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