Hi Team,
I have below Data and its expected output, Currently I am getting the result via Sumifs formula.
But I want answer using vba dictionary or Collections help to achieve same result.
Input Data is column (A:F)
Expected Output is in Column Range("H2:H5) and
Criteria is in Range("H13:J15)"
Step 1 Extract Unique value from Column "A" paste horizontally in Range("I2") onward(transpose it)
Step 2, Apply sumifs formula, Take Sum those columns which is mentioned infront of Cost Center.
Uploaded Screenshot as well.
Range("I3") FORMULA =SUMIFS($B$2:$B$20,$A$2:$A$20,I$2)+SUMIFS($C$2:$C$20,$A$2:$A$20,I$2)
Range("I4") FORMULA =SUMIFS($B$2:$B$20,$A$2:$A$20,I$2)+SUMIFS($C$2:$C$20,$A$2:$A$20,I$2)
Range("I5") FORMULA =SUMIFS($F$2:$F$20,$A$2:$A$20,I$2)
I understand vba code, I will modify as per my requirement later.
I
Thanks in advance for your help!
Regards,
mg
I have below Data and its expected output, Currently I am getting the result via Sumifs formula.
But I want answer using vba dictionary or Collections help to achieve same result.
Input Data is column (A:F)
Expected Output is in Column Range("H2:H5) and
Criteria is in Range("H13:J15)"
Step 1 Extract Unique value from Column "A" paste horizontally in Range("I2") onward(transpose it)
Step 2, Apply sumifs formula, Take Sum those columns which is mentioned infront of Cost Center.
Uploaded Screenshot as well.
Range("I3") FORMULA =SUMIFS($B$2:$B$20,$A$2:$A$20,I$2)+SUMIFS($C$2:$C$20,$A$2:$A$20,I$2)
Range("I4") FORMULA =SUMIFS($B$2:$B$20,$A$2:$A$20,I$2)+SUMIFS($C$2:$C$20,$A$2:$A$20,I$2)
Range("I5") FORMULA =SUMIFS($F$2:$F$20,$A$2:$A$20,I$2)
I understand vba code, I will modify as per my requirement later.
Cost Center Description | Basic | Arr Basic | City Compensatory Allowan | Arr CCA | H.R.A. | Cost Center Unique values horizontally Pasted | |||||
20009 | 111392.00 | 657.00 | 12353.00 | 201.00 | 44557.00 | Cost Center Description | 20009 | 20000 | 20003 | 20006 | |
20000 | 73190.00 | 584.00 | 19265.00 | 160.00 | 29276.00 | Basic | 126620.00 | 120639.00 | 128036.00 | 67594.00 | |
20003 | 91846.00 | 595.00 | 17111.00 | 645.00 | 36739.00 | City Compensatory Allowan | 24940.00 | 54786.00 | 29697.00 | 31091.00 | |
20003 | 35146.00 | 449.00 | 11662.00 | 279.00 | 14059.00 | H.R.A. | 50157.00 | 47720.00 | 50798.00 | 26871.00 | |
20006 | 16369.00 | 197.00 | 18970.00 | 68.00 | 6548.00 | ||||||
20005 | 29910.00 | 174.00 | 12230.00 | 126.00 | 11964.00 | =SUMIFS($B$2:$B$20,$A$2:$A$20,I$2)+SUMIFS($C$2:$C$20,$A$2:$A$20,I$2) | |||||
20000 | 19095.00 | 244.00 | 18782.00 | 839.00 | 7638.00 | =SUMIFS($D$2:$D$20,$A$2:$A$20,I$2)+SUMIFS($E$2:$E$20,$A$2:$A$20,I$2) | |||||
20007 | 39674.00 | 528.00 | 11525.00 | 578.00 | 15870.00 | =SUMIFS($F$2:$F$20,$A$2:$A$20,I$2) | |||||
20001 | 13067.00 | 605.00 | 18795.00 | 103.00 | 4303.00 | ||||||
20002 | 35564.00 | 395.00 | 15402.00 | 789.00 | 14226.00 | Criteria to Sum | |||||
20006 | 50807.00 | 221.00 | 11560.00 | 493.00 | 20323.00 | Cost Center Description | Take sum of headers | ||||
20008 | 42818.00 | 634.00 | 11077.00 | 207.00 | 17127.00 | Basic | Basic | Arr Basic | |||
20005 | 45113.00 | 412.00 | 18777.00 | 316.00 | 18046.00 | City Compensatory Allowan | City Compensatory Allowan | Arr CCA | |||
20004 | 86064.00 | 621.00 | 12822.00 | 404.00 | 34426.00 | H.R.A. | H.R.A. | ||||
20008 | 16388.00 | 300.00 | 13432.00 | 444.00 | 6555.00 | ||||||
20001 | 14000.00 | 495.00 | 15577.00 | 673.00 | 5600.00 | ||||||
20009 | 14000.00 | 571.00 | 11678.00 | 708.00 | 5600.00 | ||||||
20001 | 33419.00 | 213.00 | 12360.00 | 198.00 | 13368.00 | ||||||
20000 | 27014.00 | 512.00 | 15505.00 | 235.00 | 10806.00 |
I
Thanks in advance for your help!
Regards,
mg