+ Reply to Thread
Results 1 to 5 of 5

if statement module use please help

  1. #1
    Forum Contributor
    Join Date
    05-08-2005
    Location
    Australia
    MS-Off Ver
    excel 2019
    Posts
    112

    if statement module use please help

    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

  2. #2
    Max
    Guest

    Re: if statement module use please help

    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
    --
    Rgds
    Max
    xl 97
    ---
    GMT+8, 1° 22' N 103° 45' E
    xdemechanik <at>yahoo<dot>com
    ----
    "andrewm" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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
    >
    >
    > --
    > andrewm
    > ------------------------------------------------------------------------
    > andrewm's Profile:

    http://www.excelforum.com/member.php...o&userid=23130
    > View this thread: http://www.excelforum.com/showthread...hreadid=374880
    >




  3. #3
    Dana DeLouis
    Guest

    Re: if statement module use please help

    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. :>)
    --
    Dana DeLouis
    Win XP & Office 2003


    "andrewm" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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
    >
    >
    > --
    > andrewm
    > ------------------------------------------------------------------------
    > andrewm's Profile:
    > http://www.excelforum.com/member.php...o&userid=23130
    > View this thread: http://www.excelforum.com/showthread...hreadid=374880
    >




  4. #4
    Max
    Guest

    Re: if statement module use please help

    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>
    --
    Rgds
    Max
    xl 97
    ---
    GMT+8, 1° 22' N 103° 45' E
    xdemechanik <at>yahoo<dot>com
    ----



  5. #5
    Max
    Guest

    Re: if statement module use please help

    "Dana DeLouis" wrote
    > =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 !
    --
    Rgds
    Max
    xl 97
    ---
    GMT+8, 1° 22' N 103° 45' E
    xdemechanik <at>yahoo<dot>com
    ----



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1