Combine IFERROR with OR statement

Haneyg

New Member
Joined
Dec 5, 2009
Messages
15
Hello,

I am trying to combine an IFERROR statement with an OR condition. The data I am pulling from is a Pivot table, and I've figured out how to eliminate the errors when no relevant pivot row is available, but I also need to change any 0 values returned to a text format hyphen "-" for visual readability.

Current formula:

=IFERROR(GETPIVOTDATA("ID",Pivots!$B$32,"MONTH",7,"YEAR",2017,"Team","AES"),"-")

This returns correct values, but I also want to turn any 0 numeric result into a text "-" so errors and zero values would both return "-". Thoughts for solution?

Here is a visual of what I am seeing, and want to turn the zeros into hyphens: https://pasteboard.co/H7Xr0Pm.png
 
Last edited:

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Solved:

Took me another hour, but I found a solution. Couldn't figure out how to use OR correctly, so I nested two IFERROR statements within a parent IF statement for the zero values. There's likely an easier way, because this is ugly:

=IF((IFERROR(GETPIVOTDATA("ID",Pivots!$B$32,"MONTH",7,"YEAR",2017,"Team","AES"),"-"))=0,"-",(IFERROR(GETPIVOTDATA("ID",Pivots!$B$32,"MONTH",7,"YEAR",2017,"Team","AES"),"-")))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,076
Messages
6,122,987
Members
449,093
Latest member
Mr Hughes

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