+ Reply to Thread
Results 1 to 13 of 13

Nested If not working

  1. #1
    Registered User
    Join Date
    12-16-2017
    Location
    Somerset, England
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    60

    Nested If not working

    Good afternoon all, I'm new to this forum and hoping some one can help.

    I am having a specific problem and am very much hoping that you can help. I have added the simplified problem below; I am trying to get a cell on a sheet to return the name of the participant who won a given race (or came 2nd, 3rd, 4th etc) when the results are on one page, the participant name on a second and the formula on a third. I have included the formula that I have used with google forms (which uses formulas in a similar way to excel), however, the result always comes back as N/A if the first criteria is not met.

    I hope that makes sense and hope you can offer a solution.



    Sheet called Results

    A B C
    1 Team A Team B
    2 Position 1 2



    Sheet called Participants

    A B C
    1 Team A Team B
    2 Participant Matt Laura



    Sheet called Winners

    A
    1 1st Place
    2 =if(‘Results’!B2=1,’Participants!B2,if((‘Results’!C2=1,’Participants!C2))


    I very much hope some one can either see where i am going wrong or offer another suggestion.

    Thanks

    TJ

  2. #2
    Registered User
    Join Date
    12-16-2017
    Location
    Somerset, England
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    60

    Re: Nested If not working

    Sorry guys, formatted the original post to try to show the cell layout (hense the letters across the top and the numbers down the side as i cant add a table) and when i hit submit it just formatted it as a conversation, hopefully it still makes sense though.

    TJ

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,911

    Re: Nested If not working

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,145

    Re: Nested If not working

    Attach a sample workbook (not image).

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,145

    Re: Nested If not working

    Guessing

    in "Winners"

    in B2

    =IFERROR(INDEX(Participants!$A$2:$B$2,0,MATCH(INDEX(Results!$A$1:$B$1,MATCH($A2,Results!$A$2:$B$2,0)),Participants!$A$1:$B$1,0)),"")

    See attached
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    12-16-2017
    Location
    Somerset, England
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    60

    Re: Nested If not working

    Afternoon again all, i think the solution above partially solves my problem, however, having not used index before, I cant really work out who to make it do what i need.

    I have therefore attached a spreadsheet in the format i will be using it with text showing what i am trying to achieve, hopefully that gives enough information for some one to work their magic.

    I look forward to a solution!

    TJ
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,145

    Re: Nested If not working

    in B9

    =IFERROR(INDEX(Results!$B$8:$K$8,MATCH(LEFT(Winners!B$7,1)+0,Results!$B$11:$K$11,0)),"")

    in C9

    =IFERROR(INDEX(Participants!$B$8:$K$17,MATCH(Winners!$A9,Participants!$A$8:$A$17,0),MATCH(Winners!B9,Participants!$B$7:$K$7,0)),"")


    Copy these as paid to D:E and F:G

    in H9

    =IFERROR(INDEX(Results!$B$8:$K$8,MATCH(LEFT(Winners!H7,1)+0,Results!$B$11:$K$11,0)),"")

    copy across to M

    in N9

    =IFERROR(INDEX(Results!$B$8:$K$8,MATCH(LEFT(Winners!H7,2)+0,Results!$B$11:$K$11,0)),"")

    Given your current layout results you are going to have modify every formula

    The suggested format in "Results_1" is a better layout as it is easy to copy/paste any formulae.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,145

    Re: Nested If not working

    .... better still, add "Participant" column to "Results_1" for each competition. Then the "WINNERS" is a more pleasing version of your "Results_1" sheet.

  9. #9
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Nested If not working

    Amended to include improved formula at 11:48 am. Workbook also updated.
    Hi all- In B9:
    Please Login or Register  to view this content.
    In C9:
    Please Login or Register  to view this content.
    Copy B9:C9, then select D9:G9 and paste FORMULAS. Then copy B9 and paste FORMULAS in H9:N9. Now select B9:N9 and copy down.
    Attached Files Attached Files
    Last edited by leelnich; 12-16-2017 at 01:07 PM.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  10. #10
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Nested If not working

    Post # 9 formulas and attachment were updated at 11:48 am to use a more reliable way to determine position.

    ps Here's a better way to compute Class points. Paste in Results!B12 and copy across etc.:
    Please Login or Register  to view this content.
    Last edited by leelnich; 12-16-2017 at 01:34 PM.

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,145

    Re: Nested If not working

    Further update:

    Using single sheet for results ("Result_2")

    "inners"

    b9

    =IFERROR(INDEX(Results_2!$B$4:$B$13,MATCH(LEFT(B$7,1)+0,INDEX(Results_2!$C$4:BJ14,,MATCH($A9,Results_2!$C$2:$BJ$2,0)+1),0)),"")

    C9

    =VLOOKUP(B9,Results_2!$B$4:$BJ$13,MATCH($A9,Results_2!$C$2:$BJ$2,0)+1,0)

    Added hyperlinks to "Winners" column A to get to correct column in "Results_2"
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    12-16-2017
    Location
    Somerset, England
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    60

    Re: Nested If not working

    JohnTopley, your solution took me a while to make work my exact spreadsheet but it does indeed solve the problem beautifully!

    Thanks for the help!

    TJ

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,145

    Re: Nested If not working

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

+ 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. Nested if not working.
    By fleja in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2015, 09:54 AM
  2. nested while not working any more...
    By criminalspeed in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-23-2006, 02:28 PM
  3. [SOLVED] Nested IF(AND is not working
    By bj in forum Excel Formulas & Functions
    Replies: 39
    Last Post: 09-06-2005, 12:05 PM
  4. Nested IF(AND is not working
    By Todd F. in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  5. Nested IF(AND is not working
    By bj in forum Excel Formulas & Functions
    Replies: 39
    Last Post: 09-06-2005, 07:05 AM
  6. [SOLVED] Nested IF(AND is not working
    By Todd F. in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  7. Nested IF(AND is not working
    By Todd F. in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01: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