SUM of VLOOKUP Returning #N/A

redhots4

Board Regular
Joined
Aug 30, 2004
Messages
136
Office Version
  1. 365
Platform
  1. MacOS
I have a pricing table with three rows at the bottom for optional products. They aren't always included - when they are, the quantity by month is also populated. I'm using a SUM (VLOOKUP) formula to look up the prices for each asset, then multiply by the quantities for a given month to return a monthly subtotal in Row 12. As you can see in my sheet, if cells A9-A11 are blank, the formula returns #N/A.

How do I tell Excel to ignore the blanks in rows 9-11?

SF Practice Operating Model.xlsx
ABCD
1AssetMon. 1Mon. 2Mon. 3
2Asset #1333
3Asset #2444
4Asset #3444
5Asset #4757
6Asset #5000
7Asset #6055
8Asset #7400
9
10
11
12Total Cost#N/A#N/A#N/A
13
14Cost TableCost
15Asset #110
16Asset #215
17Asset #323
18Asset #414
19Asset #519
20Asset #615
21Asset #74
22Asset #810
23Asset #96
24Asset #1013
Sheet1
Cell Formulas
RangeFormula
B12:D12B12=SUM(VLOOKUP($A$2:$A$11,$A$15:$B$24,2,FALSE)*$B2:B11)
Cells with Data Validation
CellAllowCriteria
A9:A11List=$A$22:$A$24
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Hi,

Can you show expected results ?
 
Upvote 0
I'm guessing this is what you mean:

Book3.xlsx
ABCD
1AssetMon. 1Mon. 2Mon. 3
2Asset #1333
3Asset #2444
4Asset #3444
5Asset #4757
6Asset #5000
7Asset #6055
8Asset #7400
9
10
11
12Total Cost296327355
13
14Cost TableCost
15Asset #110
16Asset #215
17Asset #323
18Asset #414
19Asset #519
20Asset #615
21Asset #74
22Asset #810
23Asset #96
24Asset #1013
Sheet1046
Cell Formulas
RangeFormula
B12:D12B12=SUMPRODUCT(($A2:$A11=$A15:$A24)*($B15:$B24)*B2:B11)
 
Upvote 0
Another option
+Fluff 1.xlsm
ABCD
1AssetMon. 1Mon. 2Mon. 3
2Asset #1333
3Asset #2444
4Asset #3444
5Asset #4757
6Asset #5000
7Asset #6055
8Asset #7400
9
10
11
12Total Cost296623978
13
14Cost TableCost
15Asset #110
16Asset #215
17Asset #323
18Asset #414
19Asset #519
20Asset #615
21Asset #74
22Asset #810
23Asset #96
24Asset #1013
Master
Cell Formulas
RangeFormula
B12:D12B12=SUM(XLOOKUP($A$2:$A$11,$A$15:$A$24,$B$15:$B$24,0,0)*$B$2:B11)
 
Upvote 0
Solution
Thank you - this works in the demo example that I included. However, when I repurpose this formula on my larger use case, I still get an N/A. I think the reason may be the number of assets I have in the Cost table. Not every asset in the Cost Table will be in the Asset (top) table every time. If the number of rows in the top and bottom tables are mismatched, it returns N/A.

SF Practice Operating Model.xlsx
ABCD
1AssetMon. 1Mon. 2Mon. 3
2Asset #1333
3Asset #2444
4Asset #3444
5Asset #4757
6Asset #5000
7Asset #6055
8Asset #7400
9
10
11
12Total Cost#N/A#N/A#N/A
13
14Cost TableCost
15Asset #110
16Asset #215
17Asset #323
18Asset #414
19Asset #519
20Asset #615
21Asset #74
22Asset #810
23Asset #96
24Asset #1013
25Asset #1113
26Asset #1212
27Asset #1315
28Asset #1416
29Asset #1511
30Asset #1614
31Asset #1717
32Asset #1815
33Asset #1910
34Asset #2016
35Asset #2117
36Asset #2213
Sheet1
Cell Formulas
RangeFormula
B12:D12B12=SUMPRODUCT(($A2:$A11=$A15:$A36)*($B15:$B36)*B2:B11)
Cells with Data Validation
CellAllowCriteria
A9:A11List=$A$22:$A$24
 
Upvote 0
If @Fluff interpretation is correct, just Anchor the $B2 in my formula:

Book3.xlsx
ABCD
1AssetMon. 1Mon. 2Mon. 3
2Asset #1333
3Asset #2444
4Asset #3444
5Asset #4757
6Asset #5000
7Asset #6055
8Asset #7400
9
10
11
12Total Cost296623978
13296327355
14Cost TableCost
15Asset #110
16Asset #215
17Asset #323
18Asset #414
19Asset #519
20Asset #615
21Asset #74
22Asset #810
23Asset #96
24Asset #1013
Sheet1046
Cell Formulas
RangeFormula
B12:D12B12=SUMPRODUCT(($A2:$A11=$A15:$A24)*($B15:$B24)*$B2:B11)
B13:D13B13=SUMPRODUCT(($A2:$A11=$A15:$A24)*($B15:$B24)*B2:B11)
 
Upvote 0
Have you tried the formula from post#5, as that will handle different sized data.
 
Upvote 0
Have you tried the formula from post#5, as that will handle different sized data.
Yes - thank you BOTH! The formula you provided, Fluff, works perfectly. Thanks a million! I'll mark yours as the solution, Fluff.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,750
Messages
6,126,663
Members
449,326
Latest member
asp123

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