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.

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

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

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest