+ Reply to Thread
Results 1 to 3 of 3

Referencing a cell to determine operator in IF Logical Test

  1. #1
    Registered User
    Join Date
    05-30-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Referencing a cell to determine operator in IF Logical Test

    Hello

    So I have a spreadsheet that works out our team KPIs.

    What I want to do is create an IF statement that checks a cell to determine whether the operator in the logical test should be > or <.

    C4 is the Score (a percentage)
    AD13 is the operator
    AC13 is the value to compare with

    I have tried ="=IF("&C4&AD13&AC13&",0,2)" which I thought would work, but that way it is just shown as text.

    I have also tried =IF(C4&AD13&AC13,0,2) but that just shows a #VALUE! error..

    Your help would be appreciated!

    Thanks

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Referencing a cell to determine operator in IF Logical Test

    I am confused.

    Is this for a Macro or for a formula.

    If this is a formula then:

    =IF(AD13="<",IF(C4<AC13,0,2),"") & IF(AD13=">",IF(C4>AC13,0,2),"")
    Last edited by mehmetcik; 12-06-2014 at 03:30 PM.

  3. #3
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Referencing a cell to determine operator in IF Logical Test

    Why are we not using the CODE in this thread?

    That # is to wrap your data in code tags so that it is clear and separate from the verbiage on the sheet.

    If MehMetcik resolved your issue be sure to set as Solved through Thread Tools near the top.


    Explanation of why your attempts are failing.

    The IF AND statement is done through the word AND, the use of an Amperes symbol & is to combine or concatenate things together. SO
    Please Login or Register  to view this content.
    would result in
    YesNo
    .

    So to begin with, that was where you initially went wrong.

    For IF AND you want to use this syntax

    =IF(AND(LOGIC Statement 1,Logic Statement 2, Logic Statement 3, etc..),ACTION When True, ACTION When False)
    Each logic statement is a standalone check, but all of the checks you do within the And statement must pass in order for your TRUE to take effect, otherwise if any fail it goes to False.

    Now you can do the same thing with an OR, Same format only replace AND with OR. This will make it so that as long as Any of the logic statements you put in pass, TRUE will take effect.

    You can have as many logic statements as you see fit hence the etc... just stick to that format and you will be good to write your own formula!

    To end this - Please share more than cell references so we can further understand where you are going with this. That will only help us help you...and if possible post a test book with a before and after sheet showing where you start, and the results that you expect to achieve!

    Enjoy
    Last edited by ELeGault; 12-07-2014 at 05:19 AM.
    -If you think you are done, Start over - ELeGault

+ 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. [SOLVED] Using cell references in IF logical test
    By Petijandro in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 02-01-2013, 09:34 AM
  2. IF Logical Test for Time Range In Cell
    By Bob McCusker in forum Excel General
    Replies: 8
    Last Post: 07-23-2010, 04:58 AM
  3. If false, do the logical test for next cell
    By Zvetam in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-21-2008, 07:48 AM
  4. Logical Test comparison using cell color
    By chamuko in forum Excel General
    Replies: 2
    Last Post: 11-08-2005, 11:25 PM
  5. [SOLVED] logical test for each and every cell in range
    By matt in forum Excel General
    Replies: 5
    Last Post: 09-16-2005, 07:05 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