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
Bookmarks