VLOOKUP formula for multiple criteria without helpwe column

Wafee

Board Regular
Joined
May 27, 2020
Messages
104
Office Version
  1. 2013
Platform
  1. Windows
Hi, I have below formula where it initially checks if B is empty and if it is empty it does a vlookup with values in respective "A" column.

First vlookup is working as expected but need help with 2nd vlookup which is highlighed in red.

for 2nd vlookup i need formula that checks values in both column A and B in both the sheets without including any helper column and comes up with a value from the grand total column.



IF($B4= "",VLOOKUP($A4,Pivot!A:AZ,MATCH("Grand Total",Pivot!$A$2:$AZ$2,0),0),VLOOKUP($B4,Pivot!A:AZ,MATCH("Grand Total",Pivot!$A$2:$AZ$2,0),0))
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
I took a stab at what I think your asking

IF($B4= "",VLOOKUP($A4,Pivot!A:AZ,MATCH("Grand Total",Pivot!$A$2:$AZ$2,0),0),VLOOKUP($A4,Pivot!A:AZ,MATCH("Grand Total",Pivot!$A$2:$AZ$2,0),0)+VLOOKUP($B4,Pivot!A:AZ,MATCH("Grand Total",Pivot!$A$2:$AZ$2,0),0))

Would you be able to to post an example of what you are looking for? I'm not sure I fully understand what you're asking.
 
Upvote 0
I took a stab at what I think your asking

IF($B4= "",VLOOKUP($A4,Pivot!A:AZ,MATCH("Grand Total",Pivot!$A$2:$AZ$2,0),0),VLOOKUP($A4,Pivot!A:AZ,MATCH("Grand Total",Pivot!$A$2:$AZ$2,0),0)+VLOOKUP($B4,Pivot!A:AZ,MATCH("Grand Total",Pivot!$A$2:$AZ$2,0),0))

Would you be able to to post an example of what you are looking for? I'm not sure I fully understand what you're asking.
Hi ekrause,

let us say below is my outputsheet and formula will e put in column "C"

Book4
ABC
1Name 1Name 2Grand Total
2Hari
3HariSam
4HariBlanks
Sheet1


and here is my source sheet.

Book4
FGH
1Name 1Name 2Grand Total
2Hari40
3HariSam30
4HariBlanks20
5MuratSam10
Sheet1


so for the first name in A2 as B2 is empty it is enough to look for "Hari" and pull the amount. but for nect two cellls it should take a combination of both (A3 & B3) and then should go and check same in the put (A Column data & B Column data ) and then match the grand total column and pull the respective value.
 
Upvote 0
Use a Sumifs formula =SUMIFS($H$2:$H$5,$F$2:$F$5,A2,$G$2:$G$5,B2)

If that doesn't work use a sumproduct formula. These formulas can get time intensive if you are using big data sets.

I wrote the formula based on the screen shots above

=SUMPRODUCT($H$2:$H$5,($F$2:$F$5=A2)*1,($G$2:$G$5=B2)*1)
 
Upvote 0
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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