RoCrow
RoCrow

Reputation: 31

Calculated Field Custom Formula not working in Google Sheets Pivot Table

Here's a dummy spreadsheet of data and a pivot table

I've got data in column A (Person) and column B (CheckedIn).

People have CheckedIn values of between 0 and 6.

I want a Calculated Field to show a number beside each person that is reflective of their CheckedIn value:

(so I can then create a pie chart from the calculated field column)

For my Calculated Field Custom Formula I'm using:

=IF(CheckedIn = 0, "0 Check-ins", IF(CheckedIn = 1, "1 Check-in", IF(CheckedIn = 2, "2 Check-ins", IF(CheckedIn = 3, "3 Check-ins", "4+ Check-ins"))))

Summarise by is set to Custom.

Unfortunately, this is only giving me 0 for anyone with a 0 (which is right) or 4+ Check-ins for everyone else (regardless of how many check ins they have, which is wrong):

enter image description here

Can anyone see what I'm doing wrong?

Upvotes: 0

Views: 423

Answers (1)

rockinfreakshow
rockinfreakshow

Reputation: 30289

You may try:

=switch(counta(CheckedIn),0,"0 Check-ins",1,"1 Check-in",2,"2 Check-ins",3,"3 Check-ins","4+ Check-ins")

enter image description here

Upvotes: 0

Related Questions