+ Reply to Thread
Results 1 to 11 of 11

Return first value (duplicates) based on multiple criterias

  1. #1
    Registered User
    Join Date
    12-15-2013
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    8

    Return first value (duplicates) based on multiple criterias

    Hi alle, hope someone can help me 

    I’m having trouble returning the first value, amongst duplicates based on multiple criterias

    I have 3 sheets, where 2 of the sheets are raw data and the third is one where I’ve combined the necessary data I need.

    S3 looks like the following:
    Name---------- Month---------- Year---------- Salary---------- Hours---------- Account
    Anne---------- 09--------------------2013---------- 5500---------- 145-------------------- ??
    Thomas----------09--------------------2013---------- 3500---------- 134-------------------- ??
    Anne---------- 10--------------------2013---------- 5400---------- 135-------------------- ??
    Beth---------- 10-------------------- 2013---------- 2000---------- 100-------------------- ??

    Salary is from S1, and Hours and Account are from S2.
    I’ve had to sum the hours, so that it would only occur in one row. S2 looks like this.
    Name---------- Month---------- Year-------------------- Hours---------- Account
    Anne---------- 09--------------2013-------------------- 45-------------------- 500
    Anne---------- 09--------- -----2013-------------------- 50-------------------- 500
    Anne---------- 09-------- -------2013------------------ 50-------------------- 500
    Thomas----------09---- ------------2013------------------ 69-------------------- 500
    Thomas----------09----------------2013-------------------- 30-------------------- 500
    Thomas----------09----------------2013-------------------- 5-------------------- 500
    Anne---------- 10---------------2013-------------------- 120-------------------- 510
    Anne---------- 10---------------2013-------------------- 15-------------------- 510
    Beth---------- 10--------------- 2013-------------------- 60-------------------- 500
    Beth---------- 10--------------- 2013-------------------- 40-------------------- 500

    My task now is to return the accounnumber from S2 into S3. Because they are duplicates, I can’t seem to figure it out.
    I’ve tried with an if & and function, like:
    If(and(s2year=s3year,s2month=s3month,s2name=s3name,s1account=500),500,510)
    But it only returns 510 all the way down. I’ve tried other ways and googling it, but I can’t seem to figure it out. I would rather not remove the duplicates, because as I said it’s the raw data, and I don’t want to touch that. Hope someone can help me 
    Last edited by krdka; 12-15-2013 at 06:12 PM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Return first value (duplicates) based on multiple criterias

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. 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 demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

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

    Re: Return first value (duplicates) based on multiple criterias

    Try this go get the account number.......

    Please Login or Register  to view this content.
    This is an array formula so it needs to be confirmed with Ctrl+Shift+Enter and then drag down.

    Please find the attached sheet to see if this is what you want.
    Attached Files Attached Files
    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.

  4. #4
    Registered User
    Join Date
    12-15-2013
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    8

    Re: Return first value (duplicates) based on multiple criterias

    Hi
    Thanks for the quick response.

    I have attached a workbook. krdka_excelforum.xlsx

    Hope this is enough,

    Sincerely, Kristine

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Return first value (duplicates) based on multiple criterias

    Does the attached help ?
    Attached Files Attached Files
    Last edited by Pepe Le Mokko; 12-15-2013 at 03:53 PM.

  6. #6
    Registered User
    Join Date
    12-15-2013
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    8

    Re: Return first value (duplicates) based on multiple criterias

    Hmm no, it doesn't. The value should be 500 or 510, depending on what it is on S2. It looks good until H16, but then the values are much higher than 500.
    Last edited by krdka; 12-15-2013 at 03:59 PM.

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Return first value (duplicates) based on multiple criterias

    Is your calculation set to Automatic?

  8. #8
    Registered User
    Join Date
    12-15-2013
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    8

    Re: Return first value (duplicates) based on multiple criterias

    I'm sorry, what does that mean?

  9. #9
    Registered User
    Join Date
    12-15-2013
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    8

    Re: Return first value (duplicates) based on multiple criterias

    Screen Shot 2013-12-15 at 21.01.37.png

    Don't know if it looks the same on my end, as in yours? But the values should match the values in red.

  10. #10
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Return first value (duplicates) based on multiple criterias

    I thought I had misunderstood your question, now I'm sure of it

  11. #11
    Registered User
    Join Date
    12-15-2013
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    8

    Re: Return first value (duplicates) based on multiple criterias

    Thanks for your help

    I've figured it out myself, in the meantime. A bit "clumsy" way, without any fancy formulas. But basically I sum up all the numbers with same criteria - count how many of these occurences are there - and divide them by each other. So it gives me an average, which turns out to be either 500 or 510. As I said - very simple, but it solves the problem :D
    Attached Files Attached Files

+ 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. Return first value (duplicates) based on multiple criterias
    By krdka in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-15-2013, 04:46 PM
  2. [SOLVED] Return MAX date based on two criterias
    By cedequ in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-04-2013, 05:11 AM
  3. Return to cell with multiple criterias
    By mmaxumus2008 in forum Excel General
    Replies: 5
    Last Post: 01-20-2012, 09:52 AM
  4. selecting multiple criterias to return one variable
    By mariasyrny in forum Excel General
    Replies: 4
    Last Post: 02-09-2009, 12:14 PM
  5. Replies: 4
    Last Post: 07-24-2008, 11:41 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