HighAndWilder
Well-known Member
- Joined
- Nov 4, 2006
- Messages
- 660
- Office Version
- 365
- Platform
- Windows
I would like to display dates in an array as an ordinal number.
I have an array of dates which could be thousands in numbe :
01/01/2024 02/01/2024 03/01/2024 04/01/2024 05/01/2024
The array could hold the actual day instead of the date.
This will return the ordinal suffix where * represents the day number.
IF(OR(VALUE(RIGHT(DAY(*),2))={11,12,13}),"th",IF(OR(VALUE(RIGHT(DAY(*)))={1,2,3}),CHOOSE(RIGHT(DAY(*)),"st","nd","rd"),"th"))
How do I implement this for each element of the dates / days array?
I thought about having a constant as below and create an array using TEXTSPLIT
1st,2nd,3rd,4th,5th,6th,7th,8th,9th,10th,11th,12th,13th,14th,15th,16th,17th,18th,19th,20th,21st,22nd,23rd,24th,25th,26th,27th,28th,29th,30th,31st
and then using INDEX to return the correct element represented by X but I still don't know how to merge the two arrays.
INDEX(TEXTSPLIT("1st,2nd,3rd,4th,5th,6th,7th,8th,9th,10th,11th,12th,13th,14th,15th,16th,17th,18th,19th,20th,21st,22nd,23rd,24th,25th,26th,27th,28th,29th,30th,31st",","),X)
Also is there a way to call a UDF passing an array and returning a new / edited array?
Thanks
I have an array of dates which could be thousands in numbe :
01/01/2024 02/01/2024 03/01/2024 04/01/2024 05/01/2024
The array could hold the actual day instead of the date.
This will return the ordinal suffix where * represents the day number.
IF(OR(VALUE(RIGHT(DAY(*),2))={11,12,13}),"th",IF(OR(VALUE(RIGHT(DAY(*)))={1,2,3}),CHOOSE(RIGHT(DAY(*)),"st","nd","rd"),"th"))
How do I implement this for each element of the dates / days array?
I thought about having a constant as below and create an array using TEXTSPLIT
1st,2nd,3rd,4th,5th,6th,7th,8th,9th,10th,11th,12th,13th,14th,15th,16th,17th,18th,19th,20th,21st,22nd,23rd,24th,25th,26th,27th,28th,29th,30th,31st
and then using INDEX to return the correct element represented by X but I still don't know how to merge the two arrays.
INDEX(TEXTSPLIT("1st,2nd,3rd,4th,5th,6th,7th,8th,9th,10th,11th,12th,13th,14th,15th,16th,17th,18th,19th,20th,21st,22nd,23rd,24th,25th,26th,27th,28th,29th,30th,31st",","),X)
Also is there a way to call a UDF passing an array and returning a new / edited array?
Thanks