vlookup based on if function

kypok999

New Member
Joined
Oct 20, 2017
Messages
41
hi Guys,

I have data range I need to lookup for:

I attached the file so I am looking for unique id as in "Combined Sheet" column A2 I need to produce result in column x,y,z but need to be based on x1 y1 z1 values so its looking for A2 in sheet "Top3FAVData" if x1 =1 for x column and if y1=1 and z1=1 for y ,z columns so bascially lookup should look for A2+$x1 from "Combined sheet" in "Top3FAVData" it would look into A2 column +z2 and show result from AE column

I copy pasted result in x1,y2,z2 how it should look like with formula

Thank you in advance sorry if I wrote this complicated..

https://docs.google.com/spreadsheets/d/110-z6_x0U14iHWS5kAWjSg1S4-USAZ8vXE-AIxrLaXc/edit?usp=sharing
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
@kypok999, here is what I would recommend:

Combined!X2 formula:

=INDEX(TOP3FAVData!$AE:$AE, MATCH(A2,TOP3FAVData!$A:$A,0))

Combined!Y2 formula:

=INDEX(TOP3FAVData!$AE:$AE, MATCH(A2,TOP3FAVData!$A:$A,0)+1)

Combined!Z2 formula:

=INDEX(TOP3FAVData!$AE:$AE, MATCH(A2,TOP3FAVData!$A:$A,0)+2)

Of course, I can't test that on your sheet itself. But I believe those should work for what you're trying to do.
 
Last edited:
Upvote 0
@kypok999, glad to help.

By the way, if there will be times when your ID in Combined! may not be found in the second sheet, you may want to wrap each formula I provided in an IFERROR(). For instance:

=IFERROR(INDEX(TOP3FAVData!$AE:$AE, MATCH(A2,TOP3FAVData!$A:$A,0)),"NOT FOUND")
 
Upvote 0
@kypok999, again, it's difficult to write formulas without being able to test them. But see if this works in Combined!AA2 (and then drag-copied down as needed):

=IF(SUMPRODUCT((TOP3FAVData!A:A=$A2)*(TOP3FAVData!O:O=1))=0,"",SUMPRODUCT((TOP3FAVData!A:A=$A2)*(TOP3FAVData!O:O=1)*(TOP3FAVData!Z:Z)))

There are places in your TOP3FAVData! list where no match will be found for that ID in A:A with a 1 in O:O (i.e., O:O is all zeros for that ID). In that case, the above formula will leave Combined!AA:AA blank.
 
Last edited:
Upvote 0
Alex, I don't download spreadsheets from the Internet for security purposes.

Did you try the formula I provided for you? I don't see it in the spreadsheet.
 
Upvote 0
Alex, try this in AA2 and copied down:

=IF(SUMPRODUCT((TOP3FAVData!A:A=$A2)*(TOP3FAVData!O:O=1))=0,"",INDEX(TOP3FAVData!Z:Z, SUMPRODUCT((TOP3FAVData!A:A=$A2)*(TOP3FAVData!O:O=1)*ROW(TOP3FAVData!O:O))))
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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