sum data between two cell values

slamanager

Board Regular
Joined
Apr 20, 2007
Messages
129
Hi All,

I know this is a question like using Sumproduct to total data between dates but i just cant get this to work.

Each line in the report shows a status change with in a record there are multiple records in the report, also there are random combinations of status changes per record. Im trying to sum the minutes in duration between two of the status types.

example data in cols A B C. A is the record ID B is the Status value and C is the duration for each status.
INC0001, Start, 15
INC0001, Process1, 5
INC0001, Process2, 11
INC0001, Process4, 6
INC0001, Process1, 5
INC0001, End, 7
INC0001, Refresh, 5
INC0002, Start, 15
INC0002, Process1, 5
INC0002, Process2, 14
INC0002, Process1, 5
INC0002, End, 7

So I need to calc the duration for INC0001 between Start and End points giving a total of 49 and INC0002 total of 46. the sumproduct example i have is for date ranges which ive tried to modify by unsure how to combine the INC ref and the status and then add up between those points.

Cheers
 

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,192
IDStatusDuration INC0001
INC0001Start15 Start
INC0001Process15 End
INC0001Process211 49
INC0001Process46
INC0001Process15
INC0001End7
INC0001Refresh5
INC0002Start15
INC0002Process15
INC0002Process214
INC0002Process15
INC0002End7

<COLGROUP><COL style="WIDTH: 48pt" span=3 width=64><COL style="WIDTH: 20pt; mso-width-source: userset; mso-width-alt: 967" width=27><COL style="WIDTH: 18pt; mso-width-source: userset; mso-width-alt: 853" width=24><COL style="WIDTH: 48pt" width=64><TBODY>
</TBODY>

Not sure if this is possible/easy with a pivot table. What follows is a formula approach...

F4, control+shift+enter, not just enter:
Rich (BB code):
=SUM(
  IF(ROW($B$2:$B$13)-ROW(B$2)+1>=MATCH(F2,IF($A$2:$A$13=F1,$B$2:$B$13),0),
  IF(ROW($B$2:$B$13)-ROW(B$2)+1<=MATCH(F3,IF($A$2:$A$13=F1,$B$2:$B$13),0),
  IF($A$2:$A$13=F1,$C$2:$C$13))))
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,241
Messages
5,510,013
Members
408,772
Latest member
Bmort

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top