+ Reply to Thread
Results 1 to 4 of 4

Referencing two cells for logical_test

Hybrid View

  1. #1
    Registered User
    Join Date
    07-10-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Referencing two cells for logical_test

    I have a fairly simple function that I'm having trouble with.
    At the moment my function looks like this:

    =IF(D12="Y","A",IF(D12="N","C","B"))

    It only works if I use D12 as the logic test. But I need to reference 2 cells (both D12 and E12).
    I've tried:

    =IF(D12:E12="Y","A",IF(D12:E12="N","C","B"))

    But I keep getting #VALUE errors.

    I'm at a loss as how to do this. I've searched everywhere but found nothing, unless I should be using an AND function...

    Thanks in advance!
    Last edited by Nitros; 07-11-2010 at 08:09 AM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Referencing two cells for logical_test

    Hi Nitros,
    Welcome to the forum.
    Try...

    =IF(and(D12="Y",E12="Y"),"A",IF(and(D12="N",E12="Y"),"C","B"))
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    07-10-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Referencing two cells for logical_test

    Awesome!!!

    The formula works as required. Saved me a lot of time.

    Thanks pike!

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Referencing two cells for logical_test

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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