Skip to main content

IF and multiple choices

  • February 16, 2023
  • 1 reply
  • 11 views

Forum|alt.badge.img+6

Hello community!

I have a column with 3 simple choices "number of trucks" and I wants to convert these choices into figures in a "quantity" column. 

IF({number of trucks} = "3 trucks of more", "0", )
IF({number of trucks} = "1 truck (24 tons)", "24",)
IF({number of trucks} = "2 trucks (48 tons)", "48",)

I can't close my formula, do you have an idea?

1 reply

TheTimeSavingCo
Forum|alt.badge.img+31
  • Brainy
  • 6416 replies
  • February 16, 2023

Try:

IF({number of trucks} = "3 trucks of more", "0") & IF({number of trucks} = "1 truck (24 tons)", "24") & IF({number of trucks} = "2 trucks (48 tons)", "48")

You could also use a SWITCH() instead:

SWITCH( {number of trucks}, "3 trucks of more", "0", "1 truck (24 tons)", "24", "2 trucks (48 tons)", "48" )