+ Reply to Thread
Results 1 to 6 of 6

If statement limited, need to know how to have text..

  1. #1
    Registered User
    Join Date
    05-28-2006
    Posts
    60

    If statement limited, need to know how to have text..

    I'm trying to have B1 as "$10.00" if A1 is "firstclass" and B2 as "$20.00" if A1 is "prioritymail" and "$30" for "express"

    I tried using the If statement, but it's only for either true or false which is only good for 2 choices.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You can nest up to 7 IF statements...

    Try:

    =if(A1="firstclass"=10,if(A1="prioritymail",20,if(A1="express",30,"")))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Another option

    =IF(AND(MOD(A1,10)=0,A1<=30),LOOKUP(A1,{10,20,30},{"Firstclass","Prioritymail","Express"}),"")
    VBA Noob
    Last edited by VBA Noob; 06-06-2008 at 02:49 PM.
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    I'm trying to have B1 as "$10.00" if A1 is "firstclass"
    What do you want in B1 if A1 is anything else? A blank?
    Please Login or Register  to view this content.
    B2 as "$20.00" if A1 is "prioritymail" and "$30" for "express"
    Same with B2?
    Please Login or Register  to view this content.
    Is this what you want?

    ChemistB

  5. #5
    Registered User
    Join Date
    05-28-2006
    Posts
    60
    yes, you guys are fast!

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by VBA Noob
    Another option
    =IF(MOD(A1,10)=0,LOOKUP(A1,{10,20,30},{"Firstclass","Prioritymail","Express"}),"")


    VBA Noob
    I think the OP was looking for the reverse... and if so, the LOOKUP() wouldn't work... you would need VLOOKUP() with False trigger...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Find row number of text string in a range of cells
    By Steven Fleck in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-06-2013, 08:38 PM
  2. Pasting multiple lines of text into one cell
    By hoopz in forum Excel General
    Replies: 4
    Last Post: 07-11-2012, 08:28 PM
  3. "IF" Statement - find text within Range
    By mpquin in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-28-2008, 10:42 AM
  4. Moving column cells to one row of cells
    By rdaughdril in forum Excel General
    Replies: 1
    Last Post: 10-11-2007, 08:57 AM
  5. Replies: 6
    Last Post: 05-17-2007, 07:08 AM

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