Excel Data Consolidation

ialwayscapital

New Member
Joined
Aug 18, 2009
Messages
18
I am working on a salary sheet and stuck on this situation.
Sheet has a to z columns with these headings.

ScTlbSk5B8pcgtJEqy_Dlpy4HQaC2KqTFXr_QAHCwZQ2Sa4BCjyPhSi6aXq_cdUwplUqXfLYyqlcFA=w1920-h925


What i need is, if employee name and employee code repeat several times, then i get sum of his duty, wages, pf, esi, pt, gross salary, advance, uniform, add money, take home, bank cheque, bank cash & cash in hand in ANOTHER WORKSHEET.
For example,
Pooja Yadav, 25 (duty), 9750 (wages), 650 (pf), 300 (esi), 160 (pt), 8640 (gross salary), 4000 (advance), blank (uniform), blank (add money), 4640 (take home), 3820 (bank cheque), blank (cash in hand.
Things written in brackets are just for understanding sake (consider it as column heading)

Please help me out, Thanks :)
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Not view code. Its Developer tab -> Visual Basic -> Insert Module

If its F2, added an additional column.
 
Last edited:
Upvote 0
Thanks for the help, Great Support.

Initially I did figure out a following formula for I2
=INDEX($A$2:$A$50,MATCH(MAX(IF($B$2:$B$50=$H2,$E$2:$E$50)),$E$2:$E$50,0))

But i realized that this formula gives wrong result if duplicate values found. So after lots of research and experiment, somehow I got a formula (given below) that works without any issues.

Formula for I2

=INDEX($A$2:$A$50,MATCH(MAX(IF($B$2:$B$50=$H2,$E$2:$E$50)),IF($B$2:$B$50=$H2,$E$2:$E$50),0))

This one works perfectly.

Thanks again :)
 
Upvote 0
One last concern, Your VBA code doesnt have any range mentioned in it. I posted a sample (example) sheet for ease of understanding my query. My actual sheet has lots of column and rows. Will this VBA code work in actual sheet too ?
 
Upvote 0
Yes, It will. You can modify the formula according to your requirement.
 
Upvote 0
Update :
While experimenting, i found below formula for K2,

=TEXTJOIN(" | ",,IF(($B$2:$B$11=H2)*($F$2:$F$11<>"")=1,$F$2:$F$11,""))

its an array formula, so ctrl + shift + enter, I dont know if this one is perfect or not, am still experimenting.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,157
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top