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
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I didn't understand your formula. How about this:
Excel Formula:
=SUM(OFFSET(B10,0,0,1,MATCH(2,1/(K10:P10>0))))
 
Upvote 0
Solution
I didn't understand your formula. How about this:
Excel Formula:
=SUM(OFFSET(B10,0,0,1,MATCH(2,1/(K10:P10>0))))

This did not seem to work. What I am trying to calculate is the year to date total based on the month next year.
In the example below if there was data in for April then the formula should total Jan - April from the left hand table. But the zero in column L (sum total of C2:C4) is hampering that.

Thanks

Garry

1669217790480.png
 
Upvote 0
How about
Excel Formula:
=SUM(TAKE(B10:G10,,MAX(FILTER(SEQUENCE(,6),K10:P10>0))))
 
Upvote 0
Ahh sorry I see. Ok it is an array formula. You should press Ctrl+Shift+Enter together after paste.

I saw you are using XL365
 
Upvote 0
What version of Excel are you using?
 
Upvote 0

Forum statistics

Threads
1,215,326
Messages
6,124,260
Members
449,149
Latest member
mwdbActuary

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