+ Reply to Thread
Results 1 to 3 of 3

Thread: IF statement not working for selecting cell from range

  1. #1
    Registered User
    Join Date
    11-28-2011
    Location
    USA
    MS-Off Ver
    Excel 97
    Posts
    3

    IF statement not working for selecting cell from range

    I am trying to make an IF statement in cell D3 that will say IF C3 is equal to any of the cells from A1:A30, then D3 will equal the cell to the right of the equivilent cell (such as B20 if A20=C3) I cannot seem to find a quick way of doing this, besides entering a very long IF statement. Please help. Thanks

  2. #2
    Cheeky Forum Moderator Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2003, 2007, 2010
    Posts
    3,712

    Re: IF statement not working for selecting cell from range

    Since you're using Excel 97...
    If you're sure the C3 value will be in the A1:A30 list, try this:
    D3: =VLOOKUP(C3,$A$1:$B$30,2,0)

    Otherwise, try this:
    D3: =IF(COUNTIF($A$1:$A$30,C3),VLOOKUP(C3,$A$1:$B$30,2,0),"No Match")

    I *think* Excel 97 has the COUNTIF function.

    Does that help?
    Regards,

    Ron
    Microsoft MVP - Excel
    (Oct 2006 - Sep 2012)

    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    11-28-2011
    Location
    USA
    MS-Off Ver
    Excel 97
    Posts
    3

    Re: IF statement not working for selecting cell from range

    Thanks! The first one worked.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0