+ Reply to Thread
Results 1 to 6 of 6

if function in an excel cell

  1. #1
    Registered User
    Join Date
    03-16-2015
    Location
    Toronto
    MS-Off Ver
    2007
    Posts
    9

    if function in an excel cell

    I'd like to know how to put this condition in a cell

    IF 100<A1<200 THEN
    1
    ELSEIF 200<A1<300 THEN
    2
    ELSE any other value of U10
    0


    Thanks for any help!

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: if function in an excel cell

    "What does else any other value of U10" mean?

    Try

    =IF(AND(A1>100,A1<200),AND(A1>200,A1<300),2,U10))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,503

    Re: if function in an excel cell

    you could try this... =LOOKUP(A1,{0,100,200,300},{0,1,2,0})
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Registered User
    Join Date
    03-16-2015
    Location
    Toronto
    MS-Off Ver
    2007
    Posts
    9

    Re: if function in an excel cell

    Quote Originally Posted by Special-K View Post
    "What does else any other value of U10" mean?

    Try

    =IF(AND(A1>100,A1<200),AND(A1>200,A1<300),2,U10))
    sorry, i meant

    IF 100<A1<200 THEN
    1
    ELSEIF 200<A1<300 THEN
    2
    ELSE any other value of A1
    0

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,858

    Re: if function in an excel cell

    For three outputs, the IF function works well. An alternative approach, especially if this is going to expand to multiple possible outputs is to use a lookup table and one of Excel's lookup functions (VLOOKUP() is probably the first one people learn: https://support.office.com/en-us/art...8-93a18ad188a1 ) Pay particular attention to how Excel performs the lookup when the 4th argument is TRUE to understand how this will handle you "between" conditions.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Registered User
    Join Date
    03-16-2015
    Location
    Toronto
    MS-Off Ver
    2007
    Posts
    9

    Re: if function in an excel cell

    Quote Originally Posted by Sambo kid View Post
    you could try this... =LOOKUP(A1,{0,100,200,300},{0,1,2,0})
    I tried what you did but instead of 100,200... I wanted to use multiples of a value in cell E20. I don't know what's wrong

    LOOKUP(U10,{0,$E$20,2*($E$20),3*($E$20),4*($E$20),5*($E$20),6*($E$20)},{0,1,2,3,4,5,0})

+ 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. Replies: 15
    Last Post: 08-24-2013, 10:05 AM
  2. Excel function to remove -- -- -- from cell
    By gapink in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-10-2012, 09:01 PM
  3. Excel function to copy cell value
    By luca74 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-09-2012, 07:11 AM
  4. [SOLVED] Excel 2007 : Refer 3 cell’s values & make a cell address function
    By Sandeep999 in forum Excel General
    Replies: 2
    Last Post: 10-21-2010, 04:41 AM
  5. Is it possible to set the value of a cell in an excel function
    By JimRandomProgrammer in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-06-2009, 11:19 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