Sum duration values only if -3

BradleyS

Active Member
Joined
Oct 28, 2006
Messages
347
Office Version
  1. 2010
Platform
  1. Windows
The table below shows an ID reference and each -3 (shown in red in my example only) is an accumulative count of the duration and needs to be added to the value above it.

So if the ID is NOT - 3 it will be just be the adjacent duration value. However, if the ID is -3 it now has to be added to the duration above it.


Excel 2010
NOPQ
1No.IDdurationSUM
2105 
3225
43-35
54-35
6505
7615
8705
9805
10925
1110-35
121105
131205
Session_Slots
Cell Formulas
RangeFormula
Q2{=IF(O2=-3,SUM(P2:INDEX(P2:$P$12,MATCH(TRUE,(P3:$P$12=""),0))),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.


You can see my attempt at trying to make this work, but I'm having no luck

What I need is for the final output to look like this:

Excel 2010
NOPQ
17No.IDdurationSUM
181055
1922515
203-35
214-35
225055
236155
247055
258055
2692510
2710-35
2811055
2912055
Session_Slots


Any help will be most appreciated. Thank you in advance.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Try this in Q2:

Code:
{=IF(O2=-3,"",IFNA(SUM(OFFSET(P2,,,MATCH(FALSE,O3:$O$13=-3,0))),P2))}

copied down.
 
Last edited:
Upvote 0
Try replacing the IFNA with IFERROR
 
Upvote 0
Solution
Glad we could help & thanks for the feedback
 
Upvote 0
FWIW, IFNA is a real function, but it was introduced in Excel 2013.

Sounds like you're using a version that's a little older, but not older than v2007 (when IFERROR was introduced) ... if some future reader is using an older version than 2007, we'd have to use the older IF(ISNA(value),P2,value) structure as opposed to the newer IFERROR or IFNA functions.
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

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