+ Reply to Thread
Results 1 to 6 of 6

Glitched formula? IF statement does not work because of a formula in a reference cell

  1. #1
    Registered User
    Join Date
    11-04-2013
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2011
    Posts
    2

    Glitched formula? IF statement does not work because of a formula in a reference cell

    Hi all,

    I'm trying to create a formula that will return the following:
    If A1 > 21
    OR
    If A2 > 3
    Then return the value "No"
    Any other configuration would return as "Yes"

    The formula I've created is:
    =IF(A1>21,"No",IF(A2>3,"No","Yes"))

    This works just fine if the values in A1 and A2 are entered by hand or a simple calculation formula (ie. =1*20, etc.). However in my spreadsheet A2 is calculated by another IF statement. For some reason, the formula I've worked out above does not work when the value in A2 is the product of an IF statement...

    Any ideas on what my problem is?

    I'm using the Mac version of Excel 2011

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Glitched formula? IF statement does not work because of a formula in a reference cell

    Hi and welcome to the forum

    Try this shorter version...
    =if(OR(A1>21,A2>3),"NO","YES")

    Also, test to see if the formula is returning exactly 21 or 3. It may be returning 2.99, formatted to look like 3 etc

    edit: or yes, text, like jonmo suggests
    Last edited by FDibbins; 11-04-2013 at 02:01 PM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Glitched formula? IF statement does not work because of a formula in a reference cell

    Post the formulas in A1 and A2, they are probably not returning real numbers, but "Numbers stored as text"

  4. #4
    Registered User
    Join Date
    11-04-2013
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2011
    Posts
    2

    Re: Glitched formula? IF statement does not work because of a formula in a reference cell

    Quote Originally Posted by FDibbins View Post
    Hi and welcome to the forum

    Try this shorter version...
    =if(OR(A1>21,A2>3),"NO","YES")

    Also, test to see if the formula is returning exactly 21 or 3. It may be returning 2.99, formatted to look like 3 etc

    edit: or yes, text, like jonmo suggests
    Thanks for the less convoluted formula

    Quote Originally Posted by Jonmo1 View Post
    Post the formulas in A1 and A2, they are probably not returning real numbers, but "Numbers stored as text"
    Thanks! This was the problem. My formula in A2 was returning a number as text. I took the quotations off the value_if_true part of the formula and it works perfectly now.

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Glitched formula? IF statement does not work because of a formula in a reference cell

    You're welcome.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Glitched formula? IF statement does not work because of a formula in a reference cell

    Yup, what jonmo said

+ 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. Cell reference must work with formula output, not formula itself
    By Irdanwen in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-20-2012, 11:19 AM
  2. [SOLVED] Formula does not work if cell reference is not included
    By yreddic in forum Excel General
    Replies: 3
    Last Post: 08-01-2012, 05:46 PM
  3. Replies: 5
    Last Post: 10-15-2010, 11:27 AM
  4. [SOLVED] Change the work sheet name in a formula by using cell reference
    By Neel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-12-2006, 04:25 AM
  5. Need Vlookup to work with formula in reference cell
    By mikeburg in forum Excel General
    Replies: 2
    Last Post: 08-04-2005, 08:05 PM

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.6.0 RC 1