Sum of Vlookup where the lookup value is a list which contains blanks

brillstuff

New Member
Joined
Mar 5, 2022
Messages
2
Platform
  1. Windows
Can anyone help me please I have spent so many hours on this. Firstly I am not an excel expert, I can just usually google enough to get by.

I am wanting to be able to input sales data and return a total cost. The sales data will be input as item codes, and each column will be a separate sale. One sheet will have the stock codes and costs, and the other sheet the sales data.

I am trying to use a SUM(VLOOKUP but this only works when the lookup values (sales data) has no blanks. I need the formula to ignore the blanks.

I can only find answers for this when the table array has the blanks, not the lookup values.

I am using the formula =SUM(VLOOKUP(B8:B17,Stock!$A$2:$C$5,3,FALSE))



Excel help question picture.png


Thanks in advance
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi,

What version of Excel are you using, cause I don't see how that formula you posted can work, the syntax does not look correct.
I'm on Excel 2016, whether normally entered or array entered, your formula didn't work for me at all.

Try this, change/adjust cell references/ranges, add sheet name accordingly:

Book3.xlsx
ABCDEFGHI
1CodeCostSale 1Sale 2Sale 3
2100110Cost79.5759.5
310028.5
410036
510047
6
7
8100110041002
910011002
1010021002
1110041002
1210011002
1310011002
1410031002
151003
161003
171003
Sheet1035
Cell Formulas
RangeFormula
G2:I2G2=SUMPRODUCT((COUNTIF(G$8:G$17,$A2:$A5))*$C2:$C5)
 
Upvote 0
Hi,

What version of Excel are you using, cause I don't see how that formula you posted can work, the syntax does not look correct.
I'm on Excel 2016, whether normally entered or array entered, your formula didn't work for me at all.

Try this, change/adjust cell references/ranges, add sheet name accordingly:

Book3.xlsx
ABCDEFGHI
1CodeCostSale 1Sale 2Sale 3
2100110Cost79.5759.5
310028.5
410036
510047
6
7
8100110041002
910011002
1010021002
1110041002
1210011002
1310011002
1410031002
151003
161003
171003
Sheet1035
Cell Formulas
RangeFormula
G2:I2G2=SUMPRODUCT((COUNTIF(G$8:G$17,$A2:$A5))*$C2:$C5)

Thank you so much! This is a much more simple way of doing this.
Thanks again.


Also, I am using excel in outlook.
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,734
Members
449,094
Latest member
dsharae57

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