Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Quick Excel Question (Nested IF's)

  • 23-05-2010 04:32PM
    #1
    Registered Users, Registered Users 2 Posts: 1,639 ✭✭✭


    I'm using a nested IF statement that reads as if cell 1 matches cell 2 then return a certain value based on what is contained within cell 2. So basically I predict the outcome of a match, I then enter in the actual outcome and want a separate sheet that will compare results, if they match I want to return either a 1,2 or 3 depending on what I've predicted and if they don't match I want to return a 0.

    I've written it as follows:
    =IF(Predictions!$I8=Predictions!H8, (IF(Predictions!I8="F", (1), (IF(Predictions!I8="D", (2), (IF(Predictions!I8="O", (3), (0))))))))
    
    Can someone point out why the IF statement is returning a false value if the first argument is not satisfied? I thought I could nest all the IF statements and then put the false value in at the end i.e. (0)

    Can anybody help? Let me know if further clarification is needed.


Comments

  • Closed Accounts Posts: 146 ✭✭mid


    I'm using a nested IF statement that reads as if cell 1 matches cell 2 then return a certain value based on what is contained within cell 2. So basically I predict the outcome of a match, I then enter in the actual outcome and want a separate sheet that will compare results, if they match I want to return either a 1,2 or 3 depending on what I've predicted and if they don't match I want to return a 0.

    I've written it as follows:
    =IF(Predictions!$I8=Predictions!H8, (IF(Predictions!I8="F", (1), (IF(Predictions!I8="D", (2), (IF(Predictions!I8="O", (3), (0))))))))
    
    Can someone point out why the IF statement is returning a false value if the first argument is not satisfied? I thought I could nest all the IF statements and then put the false value in at the end i.e. (0)

    Can anybody help? Let me know if further clarification is needed.

    try this:

    =IF(Predictions!$I8=Predictions!H8, (IF(Predictions!I8="F", (1),  (IF(Predictions!I8="D", (2), (IF(Predictions!I8="O", (3),  (0))))))),(0))
    

    The first zero towards the end of the formula is used if I8 = H8, but not equal to F, D or O.

    The last zero in the formula is used if I8 and H8 are different.


  • Registered Users, Registered Users 2 Posts: 1,639 ✭✭✭LightningBolt


    You're a hero! Such a simple solution:) Many thanks for that.


Advertisement