Calculate adjacent column with Subtotal

deacon10

Board Regular
Joined
Aug 9, 2010
Messages
59
Office Version
  1. 365
Hi there, I am hoping someone can help,

I have the following data with a filter applied in A4 & B4

1685721168123.png



A3 is currently calculated with =SUBTOTAL(9,A5:A13).

Does anyone know how I can calculate the subtotal in B3 of column A5:A13, if the corresponding cell in B5:B13 is not blank?

In this example B3 would = 548

Any help eternally appreciated,

CF
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try:

B3:
Excel Formula:
=SUMPRODUCT(A5:A13,--(B5:B13="x"),SUBTOTAL(102,OFFSET(A5,ROW(A5:A13)-ROW(A5),0)))
 
Upvote 1
Solution
T202306a.xlsm
ABC
1
2548With a Table
3548548Without table
4AmountMarker
5277x
6167x
778x
817x
99x
130x
1c
Cell Formulas
RangeFormula
A2A2=SUBTOTAL(109,A5:A13)
A3A3=SUMPRODUCT(--(B5:B13>" "),A5:A13)
B3B3=SUMPRODUCT(--(B5:B13="x"),A5:A13)
 
Upvote 1

Forum statistics

Threads
1,216,027
Messages
6,128,367
Members
449,444
Latest member
abitrandom82

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