VLOOKUP + SUM FORMULA PLEASE

gilquenanoviii

New Member
Joined
May 18, 2022
Messages
33
Office Version
  1. 2021
Platform
  1. Windows
1671277700641.png



Hello guys, as you can see in the picture shared above.
in Pivot table, same brand "APPL" is under different categories.
please help me with the formula to use so that I will be able to get the total sum for the brand "APPL"

i use vlookup and its only giving me total of the first Appl which is -450

thank you in advance!
 
Why don't you just either rearrange the pivot or create another pivot that totals the Brands ?
 
Upvote 0
Why don't you just either rearrange the pivot or create another pivot that totals the Brands ?
Hello, because there is a lot more categories that i need to look for using this pivot table. and I wanted to use just 1 formula to get it. instead of refilterring the pivot table many times.. :(
 
Upvote 0
You should be using GETPIVOTDATA so that the formula will maintain its references as it changes. Formulas with simple cell references will break as soon as the Pivot Table changes. Turn it on in OPTIONS -> Formula.
1671279113183.png

Once you turn it on and go to a cell outside of the PT and then start a formula by typing = and then pointing to a cell in the PT, you'll see a complex GETPIVOTDATA formula automatically generate. Don't freak out - they look horrible! However, if you look carefully at the formula you'll see clues as to how to adapt it to cell F8 as a reference rather than whatever was automatically generated.
The GETPIVOTDATA formula can be used to return values which can be used in formulas.
As for the example above, VLOOKUP will only return ONE value. You should be using SUMIFS (or SUMIF if not available - I forget if the IFS formulas are available in 2016! In the case of SUMIF(S), it would be fine to reference an entire column as in this:
Book1
ABCDE
1APPL231APPL725
2B222
3C272
4D358
5APPL161
6D178
7C172
8B425
9C336
10APPL333
Sheet1
Cell Formulas
RangeFormula
E1E1=SUMIF(A1:A10,D1,B1:B10)

Hope that helps.
 
Upvote 0
Hello, because there is a lot more categories that i need to look for using this pivot table. and I wanted to use just 1 formula to get it. instead of refilterring the pivot table many times.. :(
Assuming by categories you mean AAPL, BAYKR, KYEBU etc then I would definitely be rearranging the table or creating a new one so that the brands total in the pivot and using as GETPIVOT as @jdellasala also suggested to get the data. It does not mean you have to apply any filtering.
 
Upvote 0

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