Help with formula on Pivot Table

Noxqss38242

Board Regular
Joined
Sep 15, 2017
Messages
223
Office Version
  1. 2016
Currently I have this formula:
=VLOOKUP(P7,data,2,0)/$Q$5

This formula works!
However, now I want to see "ALL" months' data and want it to say if B3 = (All) then =VLOOKUP(P7,data,14,0)/$Q$5
As you can tell the formula needs to work as well if (All) is not selected as I will also be looking at months individually so it has to ignore B3 if (All) is not selected.

Anyone know how to add this into the formula?


Thank you!
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
=IF( B3 = "(ALL)", VLOOKUP(P7,data,14,0)/$Q$5 , VLOOKUP(P7,data,2,0)/$Q$5)
OR you could use in the vlookup itself

=VLOOKUP(P7,data,IF(B3="(ALL)",14,2),0)/$Q$5
 
Upvote 0
Solution
you are welcome
Not sure about the pivot table in your title - but if thats solves the problem , great
 
Upvote 0
Wasn't sure if it being a pivot table would affect anything.

I think I'm stuck on this last data pull, though.

=VLOOKUP($B$3,TracMiles!$F$42:$R$43,2,0) (which I know it is only 2 rows now but as the months progress it will go down to row 54)

This deals with "months in service"
I may just have to have it say, if B3 says ALL then return blank

Not sure for it to say, if B3 = All then pull data from last row

If you know, great, if not, I'll just report blank
 
Upvote 0
=IF($B$3="(All)",LOOKUP(2,1/(NOT(ISBLANK(TracMiles!G42:G43))),TracMiles!G42:G43),VLOOKUP($B$3,TracMiles!$F$42:$R$43,2,0))

This works!

Shout out to ETAF

With your original formula tweak, I was able to figure more out. Thanks again!
 
Upvote 0
glad its now working for you
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,581
Members
449,089
Latest member
Motoracer88

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