+ Reply to Thread
Results 1 to 7 of 7

Assign single number to duplicate values in column

  1. #1
    Registered User
    Join Date
    06-17-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Assign single number to duplicate values in column

    Hey guys, I have another question with my scheduling book for my non-profit company.

    Right now it's set up so Clients are in Column A and the staff for each client is listed in columns B through H.

    Next to that is Clients in Column J and the hours they are in program. So the Staff are listed again in Column S and the formula in T adds up their names corresponding to the hours. This all works great thanks to some previous help on this forum:
    http://www.excelforum.com/excel-form...om-sheet2.html


    Now the new issue we have is that Staff can possibly work with multiple Clients on the same day and even though it's still a 6 hour day for example, it's counting as 12 or 18 hours.

    Is there a way to stop this from happening? Like if the column Monday detects the same name multiple times, we only want it to count for one.

    Even if we have to create another row/column just for the staff that have duplicate names... I have no idea what to do here.

    In the attachment:

    I have conditional formatting set individually for Monday - Sunday to highlight duplicate names, Right now we have Staff "Josh" on Monday working with Clients "Steve Bolhman" and "Mark Reign" Both clients are 6 hours for the day, and right now Josh is getting 12 hours instead of 6.

    We also have Staff "Ray" working with Clients "Walter Thomas" and "Bethany Timms" who are both 8 hour clients, and Ray is being paid for 16 hours instead of 8.

    If you need any clarifications please let me know. Thank you all for your help and time.

    -Steven
    Attached Files Attached Files
    Last edited by excelresumes; 07-17-2013 at 07:47 PM.

  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: Assign single number to duplicate values in column

    If you DIDN'T have people doing doubles, then the formula in T2 could be simply:

    =SUMPRODUCT(--($B$2:$H$11=S2), $K$2:$Q$11)


    I'll have to see if something more elegant comes to mind, but to get JUST the first value of each shift worked on each day, use VLOOKUP. IFERROR can trap the days they don't work at all.

    =IFERROR(VLOOKUP(S2, $B$1:$K$11, 10, 0),0)+IFERROR(VLOOKUP(S2, $C$1:$L$11, 10, 0),0)+IFERROR(VLOOKUP(S2, $D$1:$M$11, 10, 0),0)+IFERROR(VLOOKUP(S2, $E$1:$N$11, 10, 0),0)+IFERROR(VLOOKUP(S2, $F$1:$O$11, 10, 0),0)+IFERROR(VLOOKUP(S2, $G$1:$P$11, 10, 0),0)+IFERROR(VLOOKUP(S2, $H$1:$Q$11, 10, 0),0)
    _________________
    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
    Registered User
    Join Date
    02-27-2012
    Location
    Chisinau, Moldova
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    11

    Exclamation Re: Assign single number to duplicate values in column

    SI have a table with codes of the countries in Sheet2, of course it is bigger. In Sheet1 I have some name of the countries that are without codes.....please help me to fill in the column B (Sheet1) with data matched in Sheet2.
    Thanks
    Attached Files Attached Files
    Last edited by DonAx; 07-18-2013 at 01:52 AM.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Assign single number to duplicate values in column

    DonAx....Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    10-13-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Assign single number to duplicate values in column

    client_staff_duplicates.xlsx

    find attached file. if your staff works with 2 or more clients, i took the maximum hours from them. i used array formulas, it should be enterd by pressing ctrl+shift+enter.

  6. #6
    Registered User
    Join Date
    06-17-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Assign single number to duplicate values in column

    Thanks for the help guys! lugburz: I'm looking at yours right now, can you explain how you did this? I'm not familiar with array formulas, are you saying by entering a name with crtl+shift+enter it will automatically use only the largest number?

    Thanks in advanced.

  7. #7
    Registered User
    Join Date
    06-17-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Assign single number to duplicate values in column

    Just wanted to update, it's working great! Thanks again everyone, I finally understand it and have it figured out again yay!

+ 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. Counting the number of fields in a column for which there are duplicate values.
    By sangreal2007 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-24-2013, 03:59 AM
  2. [SOLVED] sort column based on number of duplicate values
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-03-2013, 12:35 PM
  3. [SOLVED] Need Urgent help on Adjacent values of Duplicate column values should be be in single row.
    By anto_01 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-11-2012, 09:55 PM
  4. [SOLVED] Assign a Value to a Duplicate Entry Within the Same Column
    By Scott C. in forum Excel General
    Replies: 4
    Last Post: 08-09-2011, 10:04 AM
  5. Finding Duplicate values within a single column
    By Ed P in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-16-2005, 07:06 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