Skip to main content
Solved

Formula for converting decimals to fractions

  • December 18, 2022
  • 3 replies
  • 51 views

Forum|alt.badge.img+14

I thought I was being clever but my formula did not work. Cells are blank. Why?

SWITCH(
  {Decimal},
  "0.75",
  "3/4",

  "0.50",
  "1/2"
)

Best answer by John_B2

If your field {Decimal} is a numeric rather than text field you should put 0.75 not "0.75" etc.

3 replies

Forum|alt.badge.img+9
  • Inspiring
  • Answer
  • December 19, 2022

If your field {Decimal} is a numeric rather than text field you should put 0.75 not "0.75" etc.


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • December 19, 2022

Is your {Decimal} field type a number, formula, or text? In addition to following John’s advice about using a number in your switch, if your field is a formula, the formula results might not be exact values to match your switch. You might need to do some rounding in your formula or you might want to consider nested IFs. 


Forum|alt.badge.img+14
  • Author
  • Known Participant
  • December 19, 2022

My {Decimal} field is indeed a number and, therefore, removing the quotation marks worked like a charm. Thanks, John_B2, for the solution. And thanks, kuovonne, for sharing suggestions in case the field wasn't a number. I really appreciate the help! 🙂