Sum values in column O until empty cell is reached whilst excluding "NO" values

jfin1ty

New Member
Joined
May 15, 2023
Messages
23
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Hoping someone can help me with this query.
I have a workbook I am working on that currently sums all the values in column "O" if the value on the same row in column "L" is "WP" or "BS" until an empty cell is reached.
I would like to expand upon this formula so that it still sums like I have mentioned above but will not include summing for any value in column "O" if the value on the same row in column AC is equal to NO. Is this possible?
I have made the start of the formula have some if, or, and, offset evaluations that are required for a plethora of reasons I'd rather not get into so really I'd imagine it would just be a tweak to the SUM formula part onwards?

Book1
ABCDEGHIJKLMNOPQRSTUVWXYZAAABAC
1T
2RG11.559SP000000WP2.705
3 WP0.960
4 WP1.945
5 WP0.634
6 WP0.480
7 WP2.555
8 SP000001BS1.220
9 BS1.060
10 
11RG12.154SP000002WP0.955
12 WP0.556
13 WP2.128
14 WP5.720
15 WP2.795
Sheet1
Cell Formulas
RangeFormula
G2:G15G2=IF(OR(H2<>"",D2<>""),IF(AND(O2<>"",OR(OFFSET(O2,-1,0)="",OFFSET(O2,-1,0)="T")),SUM(O2:INDEX(O2:$O$101,MATCH(TRUE,($O2:O$101=""),0))),""),"")
 
There is no value in cell G10 due to the neither of the offset criteria being fulfilled. If row 9 cell O9 is not blank or equal to "Tonnes (t)" then the blank value is returned to G10.
Can you give a couple of examples of sample data and expected results where rows with values in column H do get values entered in column G and any further explanation about that situation?

Also, when using XL2BB you can make your sample easier to read/navigate in the forum if you only select the relevant range and also hide irrelevant columns in that range before producing your mini sheet. For example, for the first mini sheet in post #6 you could hide columns E:F, I:K, M:N and P:AB since none of them have a bearing on the currently discussed calculation and then just select D3:AC27 to produce the mini sheet. (Columns A:C are also not relevant but can be avoided by starting the selection as indicated rather than needing to hide them)
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,223,912
Messages
6,175,341
Members
452,638
Latest member
Oluwabukunmi

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