Sum of one column based on unique values of another column and show the value in a different worksheet that has the unique value

Vinosh

New Member
Joined
Aug 30, 2014
Messages
8
Hi,

In one worksheet, I have the following data.
[TABLE="width: 483"]
<tbody>[TR]
[TD][TABLE="width: 483"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]Description[/TD]
[TD]Date[/TD]
[TD]Start Time[/TD]
[TD]End Time[/TD]
[TD]Total Duration[/TD]
[/TR]
[TR]
[TD]Registration[/TD]
[TD]28/08/2014[/TD]
[TD="align: right"]9:00:00[/TD]
[TD="align: right"]13:30:00[/TD]
[TD="align: right"]4:30:00[/TD]
[/TR]
[TR]
[TD]Registration[/TD]
[TD]29/08/2015[/TD]
[TD="align: right"]10:00:00[/TD]
[TD="align: right"]12:00:00[/TD]
[TD="align: right"]2:00:00[/TD]
[/TR]
[TR]
[TD]Registration[/TD]
[TD]29/08/2016[/TD]
[TD="align: right"]17:00:00[/TD]
[TD="align: right"]17:30:00[/TD]
[TD="align: right"]0:30:00[/TD]
[/TR]
[TR]
[TD]Search[/TD]
[TD]28/08/2017[/TD]
[TD="align: right"]14:00:00[/TD]
[TD="align: right"]16:00:00[/TD]
[TD="align: right"]2:00:00[/TD]
[/TR]
[TR]
[TD]Search[/TD]
[TD]28/08/2018[/TD]
[TD="align: right"]17:00:00[/TD]
[TD="align: right"]18:00:00[/TD]
[TD="align: right"]1:00:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

In another worksheet, where the unique value in column A is given, I need to get the sum of values in column E for unique values in column A, i.e. Registration = 7:00:00, like:

[TABLE="width: 348"]
<tbody>[TR]
[TD][TABLE="width: 348"]
<tbody>[TR]
[TD][TABLE="width: 348"]
<tbody>[TR]
[TD]C[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]Description[/TD]
[TD]Duration[/TD]
[/TR]
[TR]
[TD]Registration[/TD]
[TD]7:00:00[/TD]
[/TR]
[TR]
[TD]Search[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Enquiry[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Convert External Registrations[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Card[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

What is the formula to match the unique values in the same sheet, match it with another sheet and fetch the sum of unique values?
 
Last edited:

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
What is the formula to match the unique values in the same sheet, match it with another sheet and fetch the sum of unique values?

Hi, welcome to MrExcel.

It sounds like SUMIF() - see example below:

Excel Workbook
ABC
1DescriptionTotal
2Patient Registration7:00
3Patient Search3:00
4Patient Enquiry0:00
5Convert External Registrations0:00
6Hospital Card0:00
Sheet2
Excel Workbook
ABCDE
1DescriptionDateStart TimeEnd TimeTotal Duration
2Patient Registration28/08/201409:00:0013:30:0004:30:00
3Patient Registration29/08/201510:00:0012:00:0002:00:00
4Patient Registration29/08/201617:00:0017:30:0000:30:00
5Patient Search28/08/201714:00:0016:00:0002:00:00
6Patient Search28/08/201817:00:0018:00:0001:00:00
Sheet1
 
Upvote 0
Hi, Thanks for the quick reply.

I get 0:00:00 instead of the actual number of hours, while doing this way : =SUMIF(Sheet1!A:A,A2,Sheet1!E:E)


 
Upvote 0
You need to check 2 things:

1. That the value in A2 exactly matches the values in column A of sheet1 - you can test this with =Sheet1!A2=A2
2. That the values in column E of sheet1 are numeric - you can test this with =ISNUMBER(Sheet1!E2)

Change the 2 to one of the rows that should be summing - both formula should return TRUE.
 
Upvote 0

Forum statistics

Threads
1,225,727
Messages
6,186,679
Members
453,368
Latest member
xxtanka

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