IF Sum Vlookup Query

trish123

Board Regular
Joined
Apr 6, 2016
Messages
56
I have an excel file with product codes and descriptions of products.
Each month I receive data of all the items that are sold over the course of the month.
What I want to do is create a vlookup based on the product code in my main sheet then look at the product code on the sales data sheet, to then return the value column of each time a purchase was created based on the different products. Also Without returning 'NA'
 
The SUMIFS or SUMIF function may work better for you.
It can be dragged down row by row. Or in an aggregate function (committed with the CNTL-SHFT-ENTR keystroke -CSE).

Excel Formula:
=IFERROR(SUMIFS(Spend!$E$1:$E$37,Spend!$A$1:$A$37,$A$2:$A$8),"")


Book1
ABCDE
1VAE5
2SUQ5
3KBX5
4HRF7
5TAR5
6YQG8
7OXM5
8CTG8
9XKC10
10CYW9
11VAE8
12SUQ6
13KBX7
14HRF9
15TAR7
16YQG9
17OXM6
18CTG7
19XKC8
20CYW8
21DJM8
22HIT10
23ZFN5
24TXP8
25KSS6
26NJW7
27OYB10
28VAE8
29SUQ8
30KBX5
31HRF9
32TAR5
33YQG9
34OXM6
35CTG8
36XKC7
37CYW8
Spend


Book1
AB
1
2CTG23
3CYW25
4DJM8
5HIT10
6HRF25
7KBX17
8KSS6
Summary
Cell Formulas
RangeFormula
B2:B8B2=IFERROR(SUMIFS(Spend!$E$1:$E$37,Spend!$A$1:$A$37,Summary!A2),"")
 
Upvote 0
Solution

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Here is a comparison of SUMPRODUCT and the SUMIFS
The SUMPRODUCT Cannot be entered in just one cell, it must be copied down.
And from what i've seen the SUMPRODUCT uses more processing time than SUMIFS. Although I've not seen clear documentation. Regardless, if your worksheet is not huge it should not affect performance.

(Later Edit: You may be able to remove the error trapping in the SUMIFS, and just use:
Excel Formula:
=SUMIFS(Spend!$E$1:$E$37,Spend!$A$1:$A$37,$A$2:$A$8)
)

Book1
ABC
1SUMPRODUCTSUMIFS
2CTG2323
3CYW2525
4DJM88
5HIT1010
6HRF2525
7KBX1717
8KSS66
Summary
Cell Formulas
RangeFormula
B2:B8B2=SUMPRODUCT((Spend!$E$1:$E$37)*(Spend!$A$1:$A$37=$A2))
C2:C8C2=IFERROR(SUMIFS(Spend!$E$1:$E$37,Spend!$A$1:$A$37,$A$2:$A$8),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0
The SUMIFS or SUMIF function may work better for you.
It can be dragged down row by row. Or in an aggregate function (committed with the CNTL-SHFT-ENTR keystroke -CSE).

Excel Formula:
=IFERROR(SUMIFS(Spend!$E$1:$E$37,Spend!$A$1:$A$37,$A$2:$A$8),"")


Book1
ABCDE
1VAE5
2SUQ5
3KBX5
4HRF7
5TAR5
6YQG8
7OXM5
8CTG8
9XKC10
10CYW9
11VAE8
12SUQ6
13KBX7
14HRF9
15TAR7
16YQG9
17OXM6
18CTG7
19XKC8
20CYW8
21DJM8
22HIT10
23ZFN5
24TXP8
25KSS6
26NJW7
27OYB10
28VAE8
29SUQ8
30KBX5
31HRF9
32TAR5
33YQG9
34OXM6
35CTG8
36XKC7
37CYW8
Spend


Book1
AB
1
2CTG23
3CYW25
4DJM8
5HIT10
6HRF25
7KBX17
8KSS6
Summary
Cell Formulas
RangeFormula
B2:B8B2=IFERROR(SUMIFS(Spend!$E$1:$E$37,Spend!$A$1:$A$37,Summary!A2),"")
That works a treat thank you so much for all the help
 
Upvote 0
That works a treat thank you so much for all the help
My pleasure, happy to help.
(I just made an edit regarding the ERROR trapping, it may not be needed).

Best Wishes!
 
Upvote 0
I can't seem to get that working
First look here. If that does not solve the problem then ..
What are the symptoms and when do they occur?


I am using excel 2016.
Please update your forum profile (click your user name at the top right of the forum, then ‘Account details’) 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

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

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