GETPIVOTDATA looking for "" when pivot table uses "(blank)"

j2yuj2yu

New Member
Joined
Oct 18, 2017
Messages
2
Hi everyone,

I have a pivot table where some of the items in the row fields are blank. Here's an example:

Excel 2010
ABCD
BGoletaCA
D
D(blank)(blank)

<tbody>
[TD="align: center"]12[/TD]

[TD="align: right"]120[/TD]

[TD="align: center"]13[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]#REF![/TD]

[TD="align: center"]14[/TD]

[TD="align: right"]300[/TD]

</tbody>
Sheet4

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]D12[/TH]
[TD="align: left"]=GETPIVOTDATA("Total",$A$3,"Customer",A12,"City",B12,"State",C12)[/TD]
[/TR]
[TR]
[TH="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]D13[/TH]
[TD="align: left"]=GETPIVOTDATA("Total",$A$3,"Customer",A13,"City",B13,"State",C13)[/TD]
[/TR]
[TR]
[TH="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]D14[/TH]
[TD="align: left"]=GETPIVOTDATA("Total",$A$3,"Customer",A14,"City",B14,"State",C14)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

Questions:

1. Why does Excel put "(blank)" in the pivot table? Is there an option to set it to "" instead?
2. Because the data for Customer, City and State comes from a database, I'd rather not be massaging the data replacing "" with "(blank)". Any suggestions?
3. Is there a better way to a multi-criteria lookup? I chose GETPIVOTDATA because it seemed to be very quick and not require a lot of CPU power. Is there another formula I could look at?

BTW, I noticed that GETPIVOTDATA("Total",$A$3,"Customer",A14,"City",,"State",) works, too. That doesn't work well with formulas, though.

Thanks in advance.

Jimmy
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Welcome to the forum.

You could amend your formula like this:

=GETPIVOTDATA("Total",$A$3,"Customer",IF(A12="","(blank)",A12),"City",IF(B12="","(blank)",B12),"State",IF(C12="","(blank)",C12))

or this:

=GETPIVOTDATA("Total",$A$3,"Customer",IF(A12="",,A12),"City",IF(B12="",,B12),"State",IF(C12="",,C12))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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