if statement module use please help

  • Thread starter Thread starter andrewm
  • Start date Start date
A

andrewm

Could someone help - I have more than 7 functions to nest and come to
the conclusion to use module with vba. Sorry I cannot get it to work.
for example
=If(A1=1,"monday"),IF(A2=2,"Tuesday")).
I have tried modules and are frustated. where can I get step by step
help. or can someone attach an example spreadsheet. It would be
appreciated.

andrewm
 
If col A contains the #s 1 to 7, one way to try:

Put in B1, and copy down:
=IF(A1="","",CHOOSE(A1,"Monday","Tuesday","Wednesday","Thursday","Friday","S
aturday","Sunday"))

Col B will return what you want
 
Hi. If it's just the 7 items in your example, perhaps:
=TEXT(DATE(2001,1,A1),"dddd")

(no error checking though)
Perhaps the function "VLOOKUP" might work better for your real data.
HTH. :>)
 
Think Dana's suggestion of VLOOKUP is much better, albeit according to Excel
help, the index_num in CHOOSE allows one to select one of up to 29 values
<g>
 
=TEXT(DATE(2001,1,A1),"dddd")
Much neater ! (For the "direct" suggestion to the example in the post)
Perhaps the function "VLOOKUP" might work better for your real data.
And this is much more apt an answer to the post !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top