Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 411
  • Last Modified:

Lokking for an Excel "Day" type function.

Hi everyone....

Does anyone know of a sort of inverse of the WEEKDAY function in Excel 2003?
If I know the day "text", I'd like to use a built-in function to change "Sun"  to 2, "Thu" to 4 etc.
I know I could use =IF(A1="Sun",1,If(A1="Mon",2,........))))))). I just wondered if anyone knew of a ready made function I could enter into the cell of a Spreadsheet (NOT a VB function).
0
sts023
Asked:
sts023
  • 2
2 Solutions
 
barry houdiniCommented:
No really simply way but try

=MATCH(A1,{"Sun","Mon","Tue","Wed","Thu","Fri","Sat"},0)

or

=MATCH(A1,TEXT({1,2,3,4,5,6,7},"ddd"),0)

regards, barry
0
 
barry houdiniCommented:
...if you want it to work with either Sun or Sunday in A1 change to

=MATCH(LEFT(A1,3),TEXT({1,2,3,4,5,6,7},"ddd"),0)

regards, barry

0
 
sts023Author Commented:
Thanks Barry - that's one up for experience (or at least, lateral thinking!).
Steve.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now