0
votes

I am trying to create a new column that groups pack sizes greater than 5 into value "5+", if false, then I'd like to return its original value. How can I do so?

PackType = IF([Pack Size]>=5,"5+",Missing code)

Thanks in advance!

1

1 Answers

0
votes

Since this is a alculated column you can just add [Pack Size] as text where you've written "Missing code".

I would also sugget to use the SWITCH-function if you need to expand to more bining than just these two cases.

PackTypeText = 
IF(
    [Pack Size]>=5,
    "5+",
    FORMAT([Pack Size], "")
)

This will force all values to beckome text, if you want to keep them as number, just skip the "" and + in the if statement:

PackTypeNum = 
IF(
    [Pack Size]>=5,
    5,
    [Pack Size]
)