Countifs help needed

GarryFreeman

New Member
Joined
Apr 17, 2020
Messages
42
Office Version
  1. 365
Platform
  1. Windows
Hoping someone can help me here.
You will see that I cannot save this as a mini sheet as my Excel hates the add in and refuses to allow me to unblock the macros...

I was helped with another forum member earlier in the year with the below formula. At the time it was perfect for what I needed, but now trying to use the same formula for another piece of work.
The challenge comes when one of the figures on row 10, column K -P is Zero. in the below example I would want cell I10 to return a value of 2591 (jan 22+ Feb22+Mar22) but the zero in cell L10 is creating havoc with the formula and only adding Jan + Feb
I could add in 0.000001 but the challenge is the data is hundreds of lines long.

Any help as always would be greatly appreciated

Thanks

Garry

1669212254884.png
 
This is another array formula, but is no-volatile
Excel Formula:
=SUM(B10:INDEX(B10:G10,MATCH(2,1/(K10:P10>0))))
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
This is another array formula, but is no-volatile
Excel Formula:
=SUM(B10:INDEX(B10:G10,MATCH(2,1/(K10:P10>0))))
I also thought of this formula but then I changed my mind because I can't understand how it works.
When you evaluate the INDEX part of the formula it should return 841 (only thinking).
Howcome is SUM(B10:841) a meaningful function?
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
When you evaluate the INDEX part of the formula it should return 841 (only thinking).
In cases like this Index will return the cell address so you get Sum(B10:D10)
 
Upvote 0

Forum statistics

Threads
1,214,590
Messages
6,120,423
Members
448,961
Latest member
nzskater

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