I have 13 columns of data (i.e. 13 weeks) - and I want to count number of instances..

mickyd67

Board Regular
Joined
Jul 13, 2011
Messages
70
Office Version
  1. 365
Platform
  1. Windows
Hi All

I want to count the number of instances a number drops below zero.

However I want to be able to choose how many weeks the formula is calculating. For instance if I wanted to see all instances of a number dropping below zero I'd type 13 into an adjacent, to the formula, cell.

If I only wanted to see the number in this week I'd just type 1 into the cell, so it only looks at 1 column on data.

I am sure I did this before but I cannot find the formula I used. Please help :)
 

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
Hi MickyD67,

Does this satisfy your needs?

MickyD67.xlsx
ABCDEFGHIJKLMNOP
1Week 1Week 2Week 3Week 4Week 5Week 6Week 7Week 8Week 9Week 10Week 11Week 12Week 13WeeksCount < zero
2-4-55-4-321-1-4-145-4735
3-201-501144-5000
4-34-3-355-5-22-25-3-5
5-2-103-1-421121-4-2
61-410-4-4-4-355330
73-22132-2-1-11-120
84-4-1-53-2-50-454-10
94-2-4124035-1-3-4-3
10-432-342021503-4
1123-14-153440-33-4
122-4-3-35-24-1-432-5-4
Sheet1
Cell Formulas
RangeFormula
P2P2=SUMPRODUCT(--(A2:M12<0)*(COLUMN(A2:M12)<=O2))
Cells with Data Validation
CellAllowCriteria
O2List1,2,3,4,5,6,7,8,9,10,11,12,13
 
Upvote 0
This is great - thanks a lot for putting that effort in. This is a really handy formula.

One thing I am trying to also avoid, however, is double counting. In row 2 I'd say that is one instance as the same item goes below zero more than once. I am also aiming for unique instances (sorry if that wasn't clear :-/)

Thanks again.
 
Upvote 0
You didn't specify double counting but as row 2 has 13 entries I also don't understand what the "same item" is? Unique per row? Unique per week?
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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