View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default date format in excel 2002 on win 7

Hi

Am Sun, 3 May 2020 23:34:41 +0100 schrieb anon125:

on this forum a helpful expert posted
With a value in A1:
=A1&IF(AND(A110,A1<20),"th",CHOOSE(MOD(A1,10)+1,"
th","st","nd","rd","th","th","th","th","th","th" ))

with my version i get 10 th not 10th
same with 20.
so i changed the formula 10 and 20 to 9 and 19. worked but 30th is
still 30 th!


a little bit shorter:
=A1&IF(AND(RIGHT(A1,1)="1",A1<11),"st",IF(AND(RIG HT(A1,1)="2",A1<12),"nd",IF(AND(RIGHT(A1,1)="3",A 1<13),"rd","th")))


Regards
Claus B.
--
Windows10
Office 2016