Help with sumproduct formula

PaulPogba

New Member
Joined
Mar 9, 2018
Messages
4
Hello everyone, this is my first post,

I have tried searching the forum but wasn't exactly sure what to search for and couldn't find an answer

I have managed to get this formula from searching on the internet, which is working

=SUMPRODUCT(SUBTOTAL(103,OFFSET(H2:H8,ROW(H2:H8)-MIN(ROW(H2:H8)),,1))*(H2:H8="p"))

however, instead of using p I would like to use a number, lets say 1 in this instance, so it would give me a total of all the 1's shown in H2:H8

can this be done or does it have to be text ?

thanks in advance for your help

kind regards

PG
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Welcome to the board.

You can use any criteria that you want. Just don't put "" around the 1 if you are looking for a real number vs number stored as text.
 
Upvote 0
Thank you dreid1011, that works, so simple when you know how!

Also, I have tried to modify the range it is looking at, as I am constantly adding new rows. I have tried just putting H:H , instead of H2:H8, so it will count everything in column H but it doesn't work.

Do you know how I can do this?


Thanks again , PG
 
Upvote 0
Thanks again dreid1011, the dynamic ranges seem a bit too complicated for me so I have just extended the range it's pointing to

Using the formula I posted above , is it possible to modify it to look at second column and return a count ? say if cell A1 = X and cell B2 = Y, then it would give a total 1
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,388
Members
448,957
Latest member
Hat4Life

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