+ Reply to Thread
Results 1 to 9 of 9

Extract data from third column where data in two other columns match

  1. #1
    Registered User
    Join Date
    08-18-2010
    Location
    Lincoln, UK
    MS-Off Ver
    Professional Plus 2010
    Posts
    37

    Extract data from third column where data in two other columns match

    Hi, I have done a search for this not really following results so I have mocked up an Excel sheet to try and illustrate what it is I need to be able to do. My problem is that I need to extract the data for column C on 'Nearest Pupils Attending School' from Column E of 'Actual vs School Table' where the values in column A of 'Nearest Pupils Attending School' matches the values in Columns A and C on 'Actual vs School Table'.

    I hope that is clear; any assistance thankfully received.

    Thanks
    Attached Files Attached Files
    Last edited by redimp; 01-16-2014 at 10:30 AM.

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Extract data from thrid column where data in two other columns match

    Try these array formula. Remember to confirm these formulas with Ctrl+Shift+Enter.
    Please Login or Register  to view this content.
    and then copy across to B4 and down until you get blank row.

    And
    Please Login or Register  to view this content.
    and copy down until you get blank row.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Extract data from thrid column where data in two other columns match

    One more thing.......

    In the previous array formulas, you don't need to input the school number manually on Nearest Pupils Attending School Sheet.

    But if you are inputting the school number manually and need the formula for School Name (Col. B) and Pupils on roll for whom school is the nearest (Col. C), use the below array formulas (Ctrl+Shift+Enter)

    Please Login or Register  to view this content.
    and

    Please Login or Register  to view this content.
    then copy both the formula down.

    Hope that helps.

  4. #4
    Registered User
    Join Date
    08-18-2010
    Location
    Lincoln, UK
    MS-Off Ver
    Professional Plus 2010
    Posts
    37

    Re: Extract data from thrid column where data in two other columns match

    Thank you. With slight amendments they seem to work OK
    Formula: copy to clipboard
    Please Login or Register  to view this content.

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

    Trouble is it does not seem to make any sense whatsoever. The first one (cell C4) requires an amendment to
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    to return the correct result whereas
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    works. This appears to be the reverse of what I would expect. Can you explain please because I will need to transpose these formulas into the real much bigger spreadsheet.

  5. #5
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Extract data from thrid column where data in two other columns match

    I am not clear about where is the issue with the formula.
    The correct syntax is ROWS(A$4:A4), because it returns the first record that meets the criteria as ROWS(A$4:A4)=1 and when you copy it down to next cell it becomes ROWS(A$4:A5) which is equal to 2 so returns the next record if any.

  6. #6
    Registered User
    Join Date
    08-18-2010
    Location
    Lincoln, UK
    MS-Off Ver
    Professional Plus 2010
    Posts
    37

    Re: Extract data from thrid column where data in two other columns match

    Quote Originally Posted by sktneer View Post
    I am not clear about where is the issue with the formula.
    The correct syntax is ROWS(A$4:A4), because it returns the first record that meets the criteria as ROWS(A$4:A4)=1 and when you copy it down to next cell it becomes ROWS(A$4:A5) which is equal to 2 so returns the next record if any.
    I have amended the attached spreadsheet so that three results are returnable (attached) and put the formulas in as they appear in your first post. With the formulas as they were the result for 1112 is the result for 1111 and vice versa. The result for 1114 is correct. Usually with these it is something simple that I am missing (like a typo!)
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-18-2010
    Location
    Lincoln, UK
    MS-Off Ver
    Professional Plus 2010
    Posts
    37

    Re: Extract data from thrid column where data in two other columns match

    An additional thing that might be relevant, I just swapped 1112 and 1111 round in Column A of Number on Pupils Attending their Nearest Schools which changed the VLOOKUP school names as expected but the pupil numbers remained unchanged; so were therefore correct.

    And I have just put 1111 in cells A4 to A6 and the pupil numbers remain unchanged at:
    173
    378
    96
    Last edited by redimp; 01-16-2014 at 08:12 AM.

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Extract data from thrid column where data in two other columns match

    If you input the school number manually, please use the formula suggested in post#3.
    Pls see the attached sheet.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    08-18-2010
    Location
    Lincoln, UK
    MS-Off Ver
    Professional Plus 2010
    Posts
    37

    Re: Extract data from thrid column where data in two other columns match

    This seems to work
    Please Login or Register  to view this content.

+ 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. Replies: 2
    Last Post: 12-11-2013, 10:44 AM
  2. [SOLVED] Find unique field in one column and extract data in previous columns
    By Waqaskp in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 09-18-2013, 01:01 AM
  3. Replies: 7
    Last Post: 09-15-2013, 12:09 PM
  4. Replies: 6
    Last Post: 12-10-2012, 06:26 PM
  5. [SOLVED] Extract data from column to make new columns
    By cinco5 in forum Excel General
    Replies: 2
    Last Post: 10-10-2012, 04:18 PM

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