+ Reply to Thread
Results 1 to 20 of 20

If this then that....

  1. #1
    Registered User
    Join Date
    09-16-2011
    Location
    Lancaster, UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    41

    If this then that....

    Hi, hope someone can help us with this.

    I have two spreadsheets with data and I want to pull info from one to the other. Basically:

    If this persons employee number shows on sheet 1, check sheet 2 for the same employee number, and display info from the next cell on sheet 2 on sheet 1.

    Hope that's clearer than it reads back.....!
    Last edited by charliebeth; 03-22-2018 at 06:19 AM.

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: If this then that....

    Take a look at VLOOKUP or INDEX MATCH.

    If you require more specific assistance, consider creating a small representative sample workbook along with the desired results based on that sample data.

    To upload an Excel workbook, follow these steps:
    1) Click on "Go Advanced"
    2) Click on "Manage Attachments"
    3) Click on "Choose File"
    4) Choose your file and click on "Open"
    5) Click on "Upload"
    6) Click on "Close this window"

  3. #3
    Registered User
    Join Date
    09-16-2011
    Location
    Lancaster, UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    41

    Re: If this then that....

    I want to make this a bit clearer because it reads back like mud! It's for absence reporting.

    I have a sheet with downloaded info including employee names and employee numbers, listing all the people who were absent over the space of a week (how many days absent etc).

    My second sheet also records the names and employee numbers of people who are absent, but includes the reason why they are absent (this is completed manually after checking the absence line).

    I want to be able to get the first sheet to search the second sheet for the employee number, and display the reason for absence - pulled from the second sheet and displayed on the first sheet.

  4. #4
    Registered User
    Join Date
    09-16-2011
    Location
    Lancaster, UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    41

    Re: If this then that....

    Quote Originally Posted by 63falcondude View Post
    Take a look at VLOOKUP or INDEX MATCH.

    If you require more specific assistance, consider creating a small representative sample workbook along with the desired results based on that sample data.

    To upload an Excel workbook, follow these steps:
    1) Click on "Go Advanced"
    2) Click on "Manage Attachments"
    3) Click on "Choose File"
    4) Choose your file and click on "Open"
    5) Click on "Upload"
    6) Click on "Close this window"
    I'll give that a go

  5. #5
    Registered User
    Join Date
    03-09-2018
    Location
    Langfang, China
    MS-Off Ver
    Office 2010
    Posts
    16

    Re: If this then that....

    Hello,

    I'm not an excel expert, but here's a solution. Not sure if it's the easiest way.

    I converted the data on sheet1 to Table1 and the data on sheet2 to Table2. Then I added formulas. Please see attached.

    Hope it helps
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,519

    Re: If this then that....

    Sorry for off-topic interjection:

    Although there is no official rule regarding this behaviour, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Registered User
    Join Date
    03-09-2018
    Location
    Langfang, China
    MS-Off Ver
    Office 2010
    Posts
    16

    Re: If this then that....

    That's very good to know. Thank you.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,519

    Re: If this then that....

    Angie90 - please add the detail I requested to your post. Your response suggests you don't understand the request - if that is the case, let me know Thank you.

  9. #9
    Registered User
    Join Date
    03-09-2018
    Location
    Langfang, China
    MS-Off Ver
    Office 2010
    Posts
    16

    Re: If this then that....

    I used the INDEX/MATCH function to return the values and used IFERROR to cover up the #N/A error messages in the sample workbook.

    Sorry for some reason the system won't allow me to post the formula.
    Last edited by ANGIE90; 03-15-2018 at 02:41 PM.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,519

    Re: If this then that....

    I’ll do it for you:

    =IFERROR(INDEX(Table2[#All],MATCH([@[Employee Name]],Table2[[#All],[Employee Name]],0),),"")

  11. #11
    Registered User
    Join Date
    03-09-2018
    Location
    Langfang, China
    MS-Off Ver
    Office 2010
    Posts
    16

    Re: If this then that....

    Thank you, Ali!

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,519

    Re: If this then that....

    You’re welcome.

  13. #13
    Registered User
    Join Date
    09-16-2011
    Location
    Lancaster, UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    41

    Re: If this then that....

    Hi

    Thanks for your replies so far. I am still struggling with this, so I'll try to upload my test sheet.

    Using the Emp No to find the right person, I need Shift, Line and Reason to be populated on the first sheet from the second sheet.
    Attached Files Attached Files

  14. #14
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: If this then that....

    In E2 try this;
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    09-16-2011
    Location
    Lancaster, UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    41

    Re: If this then that....

    Quote Originally Posted by kersplash View Post
    In E2 try this;
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    AWESOME! Thank you, that works

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,519

    Re: If this then that....

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

  17. #17
    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,370

    Re: If this then that....

    Try

    in E2

    =VLOOKUP($C2,A.D.D.!$B$2:$M$8,9,0)

    OR if column heading are consistent ..

    =INDEX(A.D.D.!$B$2:$M$8,MATCH('Absence Table'!$C2,A.D.D.!$B$2:$B$8,0),MATCH('Absence Table'!E$1,A.D.D.!$B$1:$M$1,0))

    Highlighted in yellow in attached
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    09-16-2011
    Location
    Lancaster, UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    41

    Re: If this then that....

    Ah... I have hit a new problem with this.

    That =INDEX(A.D.D.!J:J,MATCH('Absence Table'!C2,A.D.D.!B:B,0)) works great, until it's trying to use info that has been displayed in a pivot table. Any suggestions?

    Referring to the example I shared above, when the first sheet is a pivot table all the responses become N/A.

  19. #19
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: If this then that....

    If it's now in a pivot table then that changes the original question.

  20. #20
    Registered User
    Join Date
    09-16-2011
    Location
    Lancaster, UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    41

    Re: If this then that....

    Yeah... Sorry. Only just noticed. I'll start a new thread!

+ 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