Question

I have an excel table that has 3 columns, one is date, the other is time, and the third is a numerical value, see below:

DATE          TIME      VALUE
01/01/2013    13:00     1
01/01/2013    13:00     1
01/01/2013    13:00     3
01/01/2013    13:30     1
01/01/2013    13:30     1
02/01/2013    13:00     2
02/01/2013    13:00     1
02/01/2013    13:30     2

What I would like to do is consolidate this table in such a way that whenever the date and time match, I would sum up the values column, therfore the end result should be like this.

DATE          TIME      VALUE
01/01/2013    13:00     5
01/01/2013    13:00     5
01/01/2013    13:00     5
01/01/2013    13:30     2
01/01/2013    13:30     2
02/01/2013    13:00     3
02/01/2013    13:00     3
02/01/2013    13:30     2

Once this is done, I can remove duplicates and have a shorter table like this:

DATE          TIME      VALUE
01/01/2013    13:00     5
01/01/2013    13:30     2
02/01/2013    13:00     3
02/01/2013    13:30     2

Unfortunately I haven't been able to come up with a formula do do this. Could someone help me?

Was it helpful?

Solution 2

SUMIFS() sounds the way to go. It lets you sum one column based on multiple conditions in others.

They syntax runs a little like this... =SUMIF([$Values],[$DataList],[Date],[$TimeList],[Time])

or in context

A             B         C      D
DATE          TIME      VALUE
01/01/2013    13:00     1      =SUMIFS($C$2:$C$8,$A$2:$A$8,A3,$B$2:$B$8,B3)
01/01/2013    13:00     1      =SUMIFS($C$2:$C$8,$A$2:$A$8,A4,$B$2:$B$8,B4)
01/01/2013    13:00     3      .
01/01/2013    13:30     1      .
01/01/2013    13:30     1      .
02/01/2013    13:00     2
02/01/2013    13:00     1
02/01/2013    13:30     2

There would be quite a lot of duplication of calculation in there but who's looking for elegant

OTHER TIPS

You just need to learn about Pivot Table.

Just select the entire table, click in Pivot table button:

enter image description here

Just select Columns Date and Time to "Row label" and Column Value to Values. Then in Values change Count of to Sum of

enter image description here enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top