+ Reply to Thread
Results 1 to 7 of 7

Multiple IF with AND formula, but One of the options is not returning correct outcome

  1. #1
    Registered User
    Join Date
    03-19-2021
    Location
    London
    MS-Off Ver
    16.16.27
    Posts
    3

    Question Multiple IF with AND formula, but One of the options is not returning correct outcome

    Hi All,

    Hope someone can help, I really cannot see where I am going wrong here.

    I am trying to get a score of either "2", "1", or "0" in column C, depending on entry in both columns A and B, as below:

    If A=Long, and B=Uptrend, then C=2
    If A=Long, and B=Sidetrend, then C=1
    If A=Long, and B=Downtrend, then C=0
    If A=Short, and B=Uptrend, then C=0
    If A=Short, and B=Sidetrend, then C=1
    If A=Short, and B=Downtrend, then C=2

    Using the following formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I am getting the correct outcome for all, except: A=Short, and B=Downtrend, which is returning "0"

    Any help would be appreciated as I am stumped.

    Workbook attached.

    Thanks in advance!
    Attached Files Attached Files
    Last edited by evenflowd; 03-19-2021 at 11:01 AM. Reason: SOLVED

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Multiple IF with AND formula, but One of the options is not returning correct outcome

    I did not look at your formula and wrote this:

    =IF(B2="Sidetrend",1,IF(OR(AND(A2="Short",B2="Downtrend"),AND(A2="Long",B2="Uptrend")),2,0))

    It gives the same wrong answer. Then I realised. There is a space after "Short " in your data validation that is throwing it out.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,795

    Re: Multiple IF with AND formula, but One of the options is not returning correct outcome

    Hi & welcome to the board.
    Both A6 & A7 have a space after short, which is why the formula is not working.
    You need to remove the space in the DV list

  4. #4
    Registered User
    Join Date
    03-19-2021
    Location
    London
    MS-Off Ver
    16.16.27
    Posts
    3

    Re: Multiple IF with AND formula, but One of the options is not returning correct outcome

    Aha!! What a silly mistake. Sorted now. Thank you very much, Glenn!

  5. #5
    Registered User
    Join Date
    03-19-2021
    Location
    London
    MS-Off Ver
    16.16.27
    Posts
    3

    Re: Multiple IF with AND formula, but One of the options is not returning correct outcome

    Yes I see that now... Thank you very much

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Multiple IF with AND formula, but One of the options is not returning correct outcome

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,795

    Re: Multiple IF with AND formula, but One of the options is not returning correct outcome

    Glad to help & thanks for the feedback

+ 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] IF Formula Looking at a Range of Cells to Figure Out Correct Outcome by Shifting Rows
    By meseleto in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-17-2019, 09:20 PM
  2. [SOLVED] Formula to choose outcome from series of options
    By archana89 in forum Excel General
    Replies: 6
    Last Post: 03-17-2019, 02:04 PM
  3. IF Formula not returning correct value
    By arpanpanchal in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-20-2018, 03:17 AM
  4. [SOLVED] formula not returning the correct value
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2016, 02:24 PM
  5. [SOLVED] "If" formula not bringing up correct outcome
    By joamer in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 11-08-2014, 01:25 PM
  6. Macro to correct formula outcome
    By pinas in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-21-2012, 12:10 AM
  7. Formula sometimes returning correct answer and sometimes returning 0
    By redimp in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2010, 06:28 AM

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