Sumif Subtotal help or better option

tezza

Active Member
Joined
Sep 10, 2006
Messages
384
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
  2. Web
Hi all,

Hope you can help as my mind has gone blank.

I have one sheet that has name, dates and durations that I will filtered out as needed.

On the second sheet I need a cell to lookup how many times a specific name shows in col A and give the subtotal of the visible durations.

Mary's name exists 10 times with a duration of 1 hour each. When filtered, Mary only shows 6 times (for example) giving a total duration of 6 hours.

Normally, I would do a simple subtotal(9,........) but I need to do it for multiple visible names created from the second sheet list.

Book1
ABCDEFGHIJ
1NameDayDuration
2Mary21-May1
3Bob21-May1
4Mary21-May1
5James21-May1
6Mary21-May1
7Mary22-May1How many Mary's have been filtered
8Bob22-May1Subtotal duration of visible Mary's
9Mary22-May1
10James22-May1eg:Col B is filtered with the 21st and 22nd
11Mary22-May1
12Mary23-May1Result
13Bob23-May1
14Mary23-May1This cell = 6
15James23-May1
16MAry23-May1
17Mary24-May1
18Bob24-May1
19Mary24-May1
20James24-May1
21MAry24-May1
22Mary25-May1
Sheet1
Cell Formulas
RangeFormula
B7:B22B7=B2+1


So F14 is this example changes depending on the filters in Col A:C
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
How about with a helper column
Fluff.xlsm
ABCDEF
1NameDayDurationMary
2Mary21/05/2024116
3Bob21/05/202411
4Mary21/05/202411
5James21/05/202411
6Mary21/05/202411
7Mary22/05/202411
8Bob22/05/202411
9Mary22/05/202411
10James22/05/202411
11Mary22/05/202411
Sheet6
Cell Formulas
RangeFormula
F2F2=SUMIFS(C:C,A:A,F1,D:D,1)
B7:B11B7=B2+1
D2:D11D2=SUBTOTAL(103,A2)


Fluff.xlsm
ABCDEF
1NameDayDurationMary
2Mary21/05/2024119
3Bob21/05/202411
4Mary21/05/202411
5James21/05/202411
6Mary21/05/202411
7Mary22/05/202411
8Bob22/05/202411
9Mary22/05/202411
10James22/05/202411
11Mary22/05/202411
12Mary23/05/202411
13Bob23/05/202411
14Mary23/05/202411
15James23/05/202411
16MAry23/05/202411
23
Sheet6
Cell Formulas
RangeFormula
F2F2=SUMIFS(C:C,A:A,F1,D:D,1)
B7:B16B7=B2+1
D2:D16D2=SUBTOTAL(103,A2)
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,157
Members
453,021
Latest member
Justyna P

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