PivotTable Calculated Item IF Statement Issue

I have two columns of data in a pivot table but one of the columns is only partially populated. I've been able to use 'Calculated Item' to add a third column that will calculate the difference between both columns, but I'd like an IF statement that ensures the 'difference' column remains blank when the partially populated column is blank.

Image showing attempted formula and result.

I've tested the logic outside of the pivot table in standard cells and this works fine. When applying the same IF logic to a formula in 'Calculated Item' however, it simply defaults to the 'else' and calculates difference no matter what. I wondered if anybody had any advice for me for this?

2

1 Answer

The problem is solved by building upon Alex M's advice.

=IF(CategoryA-CategoryB=CategoryA,"n/a",CategoryA-CategoryB) returned #VALUE! error using a text string when the IF condition was met, so selecting the pivot table option 'For error values show: n/a' functions as a crude workaround that achieves the desired result.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like