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

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,179
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))))
 

Watch MrExcel Video

Forum statistics

Threads
1,101,886
Messages
5,483,513
Members
407,397
Latest member
HerbA

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top