+ Reply to Thread
Results 1 to 13 of 13

Change cell contents if found in a list on another sheet

  1. #1
    Forum Contributor
    Join Date
    11-14-2004
    Location
    Watford, England
    MS-Off Ver
    Microsoft Office 365
    Posts
    131

    Change cell contents if found in a list on another sheet

    Hi Experts,

    I have a workbook that will have 4 sheets, "Members", "Ealry", "Late", "Night"

    In the Early, Late and Night sheets there will be a list of names in one col and pay numbers in the next col. In Members sheet there will be a list off all the staff from Earlies, Lates and Nights that are members of a certain club. What I would like to do is have a col in the Members sheet that will check all the pay numbers in the Members sheet against the pay numbers in the Early, Late and Nights sheets and when it find a match put what sheet they come from, for example "Early Member"

    I have got this working for just a workbook with a members sheet and an early sheet using this formula
    Please Login or Register  to view this content.
    What I dont know how to do is also get it to check the Late and Night sheets when I add them?

    I have attached a cut down version to give you an idea of what I am looking for.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Change cell contents if found in a list on another sheet

    First.... add the missing sheets.

    Second, use this formula:

    =IF(ISNUMBER(MATCH(E2, Early!$E:$E, 0)), "EARLY MEMBER", IF(ISNUMBER(MATCH(E2, Late!$E:$E, 0)), "LATE MEMBER", IF(ISNUMBER(MATCH(E2, Night!$E:$E, 0)), "NIGHT MEMBER", "UNKNOWN")))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,426

    Re: Change cell contents if found in a list on another sheet

    You would probably find it a lot easier if you combined Early, Late and Night into one sheet. Just add a column to differentiate them as early, late or night ... and that could be a Data Validation List for consistent entry.

    You can sort and filter this list if you want to view each category and analyse the data with a Pivot Table. You can't do any of that in separate sheets.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    11-14-2004
    Location
    Watford, England
    MS-Off Ver
    Microsoft Office 365
    Posts
    131

    Re: Change cell contents if found in a list on another sheet

    Would you be able to give me an example of what you mean using the eample I attached?
    Last edited by Cutter; 09-05-2012 at 03:06 PM. Reason: Removed whole post quote

  5. #5
    Forum Contributor
    Join Date
    11-14-2004
    Location
    Watford, England
    MS-Off Ver
    Microsoft Office 365
    Posts
    131

    Re: Change cell contents if found in a list on another sheet

    Quote Originally Posted by JBeaucaire View Post
    First.... add the missing sheets.

    Second, use this formula:

    =IF(ISNUMBER(MATCH(E2, Early!$E:$E, 0)), "EARLY MEMBER", IF(ISNUMBER(MATCH(E2, Late!$E:$E, 0)), "LATE MEMBER", IF(ISNUMBER(MATCH(E2, Night!$E:$E, 0)), "NIGHT MEMBER", "UNKNOWN")))
    Thanks worked perfectly

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Change cell contents if found in a list on another sheet

    @ fastcar

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as an infrequent user of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  7. #7
    Forum Contributor
    Join Date
    11-14-2004
    Location
    Watford, England
    MS-Off Ver
    Microsoft Office 365
    Posts
    131

    Re: Change cell contents if found in a list on another sheet

    @Cutter

    I was going to mark this post as solved as the first post did solve the question, but as I was still waiting for a reply from TMS about using data validation and pivot table I was unsure as to whether I should wait or not.

    I did also click the star to thank JBeaucaire for his quick reply and excellent answer.

    Thanks for making it for me though

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,426

    Re: Change cell contents if found in a list on another sheet

    @fastcar: sorry, didn't seem to be much point when you had a solution already. More to the point, a solution matching your existing structure.

    If you do still want it, I'll put something together.

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Change cell contents if found in a list on another sheet

    I think TMS is simply underlining that keeping 3 separate "data sheets" is an inherent pain, and atypical if you need to create reports from data that comes from all 3 sets of data.

    More typical is a SINGLE database where all rows are common. One of the columns in this consolidated database would be "MEMBERSHIP" and in that column you enter the group to which they attend. LATE, EARLY, NIGHT.

    You can use Data Validation > List on that column to put a drop down in those cells to make it easy to select LATE/EARLY/NIGHT since those are the only acceptable entries.

    Now that you have all the data on a single sheet, it is MUCH simpler to get reports from that data. And you can turn on the Data > Filter to get drop downs across the top of the data that allows you to do real-time filtering. You could filter the data in the newly added column for LATE and bingo... you're looking at only LATE membership. Edit the data, print the filtered list, whatever you need, then filter for EARLY, or NIGHT, or remove the filter to see all data again.

    A single database is a far superior database.

  10. #10
    Forum Contributor
    Join Date
    11-14-2004
    Location
    Watford, England
    MS-Off Ver
    Microsoft Office 365
    Posts
    131

    Re: Change cell contents if found in a list on another sheet

    Quote Originally Posted by TMShucks View Post
    @fastcar: sorry, didn't seem to be much point when you had a solution already. More to the point, a solution matching your existing structure.

    If you do still want it, I'll put something together.
    If you would not mind it I would appreciate it, so I could get a better understanding of what you mean

    Thanks

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,426

    Re: Change cell contents if found in a list on another sheet

    To be honest, JB has offered an absolutely superb and accurate summary of the approach I was outlining.

    I would just use VLOOKUP or INDEX/MATCH to return the Membership status.

    Combine all the existing sheets into one sheet, say Status. In column F, add the Membership status..

    The formula would look like:

    =IF(ISERROR(VLOOKUP(E2,Status!E:F,2,FALSE)),"Unknown",VLOOKUP(E2,Status!E:F,2,FALSE))

    But, that said, given that the data on the two sheets would be virtually identical, there wouldn't actually be much point having a separate database sheet.

    On that basis, we go from four sheets, down to two sheets, down to one sheet.

    But, with that one sheet, you can create a Table, you can sort, you can filter, you can analyse with Pivot Tables and Charts ... if you wish.

    Regards, TMS

  12. #12
    Forum Contributor
    Join Date
    11-14-2004
    Location
    Watford, England
    MS-Off Ver
    Microsoft Office 365
    Posts
    131

    Re: Change cell contents if found in a list on another sheet

    Thank you both for you excellent help on this matter, it is appreciated.

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,426

    Re: Change cell contents if found in a list on another sheet

    You're welcome. Thanks for the rep.

+ 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