Skip to main content

Average multiple switch formula columns

  • November 1, 2020
  • 2 replies
  • 25 views

Forum|alt.badge.img+3

I have a table with multiple single select columns. Each single select column generates a numerical value, through a switch formula. I want to average the numerical values for each switch formula column. When I average the columns out now, I get back NaN.

Here are examples of my switch formula columns:

Is there a way to do this?

2 replies

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • November 1, 2020

Your switch formulas are return strings instead of numbers. Remove the quotes around the numbers in the switch formula so that the formula returns numbers.

SWITCH({Length},
  'Less than 1 minute', 1,
  '1-3 minutes', 2,
  '3-5 minutes', 3,
  '5-7 minutes', 5,
  '7+ minutes', 8
)

Forum|alt.badge.img+3
  • Author
  • Participating Frequently
  • November 1, 2020

Your switch formulas are return strings instead of numbers. Remove the quotes around the numbers in the switch formula so that the formula returns numbers.

SWITCH({Length},
  'Less than 1 minute', 1,
  '1-3 minutes', 2,
  '3-5 minutes', 3,
  '5-7 minutes', 5,
  '7+ minutes', 8
)

This Airtable newbie is very grateful that it was a quick fix - thank you! :slightly_smiling_face: