79167936

Date: 2024-11-07 20:12:27
Score: 0.5
Natty:
Report link

Change Number Suffix using Choose()

You may use these two options depending on your preferences.

First Option: If you want to put a suffix on a certain range.

=BYROW(TOCOL(F3:F,1),LAMBDA(x,IF(VALUE(RIGHT(FLOOR(x/10),1))=1,x&"th",IFERROR(CHOOSE(RIGHT(x),x&"st",x&"nd",x&"rd"),x&"th"))))

First Output:

FirstOutput

Second Option: Based on the cell.

=F3 & CHOOSE(IF(AND(((F3)>3),((F3)<20)),
                    5,
                    MIN(RIGHT((F3),1)+1,5)),
              "th","st","nd","rd","th") & " "

Second Output:

SecondOptionOutput

References:

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Jats PPG