ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   convert weekday string to number (https://www.excelbanter.com/excel-discussion-misc-queries/30336-convert-weekday-string-number.html)

nico

convert weekday string to number
 
Is there an easy way to convert a string which is either "Monday" thru
"Sunday" into a number to work with? In particular, I want to add a 1 if the
cell contains "Monday", 2 if "Tuesday" etc.

Any ideas?
Thanks!

Don Guillett

Have a look in HELP index for LOOKUP

--
Don Guillett
SalesAid Software

"nico" wrote in message
...
Is there an easy way to convert a string which is either "Monday" thru
"Sunday" into a number to work with? In particular, I want to add a 1 if

the
cell contains "Monday", 2 if "Tuesday" etc.

Any ideas?
Thanks!




CLR

=LOOKUP(A1,{"Friday",5;"Monday",1;"Saturday",6;"Su nday",7;"Thursday",4;"Tues
day",2;"Wednesday",3})

Vaya con Dios,
Chuck, CABGx3


"nico" wrote in message
...
Is there an easy way to convert a string which is either "Monday" thru
"Sunday" into a number to work with? In particular, I want to add a 1 if

the
cell contains "Monday", 2 if "Tuesday" etc.

Any ideas?
Thanks!




Bob Phillips

=MATCH(A1,{"Monday","Tuesday","Wednesday","Thursda y","Friday","Saturday","Su
nday"},0)

--
HTH

Bob Phillips

"nico" wrote in message
...
Is there an easy way to convert a string which is either "Monday" thru
"Sunday" into a number to work with? In particular, I want to add a 1 if

the
cell contains "Monday", 2 if "Tuesday" etc.

Any ideas?
Thanks!





All times are GMT +1. The time now is 08:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com