Number query

Surreybloke

Board Regular
Joined
Apr 1, 2010
Messages
155
Office Version
  1. 365
Platform
  1. Windows
I've got a spreadsheet that adds a number, everytime it shows in another worksheet. I.e.

1 2 3 4 5 0 0 0 1 2 3 4 0 0 0 1 2 3 4 5 6 7 8 0 0 0 0 0 1 2 0

So each cell from the second column onwards is structured as follows:
=sum('Data'!A2)+A1 which in this case would give you 2 as the value in the second column, and so on and so on. I haven't been able to work out an alternative to the problem where when the next cell has a value of 0 and so repeats the final number again, other than by manually entering a 0 in the first cell where the repitition occurs.

My main query though is that for the work I'm doing, I need to calculate how many times someone has been off sick in various bands, i.e. 1 day, 2 days, 3 days, 4 days, 5 days +. A countif formula would obviously do the job, but you would then have multiple counting going on as I only want the highest number in each sequence to be counted, and not all the others preceding it. Is there a way of doing this in Excel so that in the case of the above sequence of numbers, I could report that this person was off sick for 5 days or more on 2 occasions?
 
Just got home from work so will use your suggestion tomorrow - looks good though from what you've said so looking forward to seeing the results! Many thanks for your help.
 
Upvote 0

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
That's what my formulas return.

In my real life list (see below for an example), the numbers go beyond 5 consecutive numbers which then means once you have a 6 or greater, the formula for "5" no longer counts it. For "5" I really need it to count 5 or greater rather than just 5 - I don't know if there is a way of doing that?

0 0 0 0 0 0 1 2 3 4 5 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0
 
Upvote 0
Just use Countif, as I said originally. For every 5, the sequence must be 5 or greater.
 
Upvote 0
Instead of using 5, I've tried using the greater than symbol then 5, but it doesn't return any results? The only way I could think of doing it was to do it for every single day of each month, and then have a SUM formula for 5+ days, but that would extend the size of my spreadsheet by quite a bit.
 
Upvote 0
Actually, I think I know what you're referring to...

=SUMPRODUCT(--($dn179:$eq179>=ey$5),--($do179:$er179=0))

Doing it this way then makes it work as far as I can see...
 
Upvote 0
No, I was actually referring to:
=COUNTIF($dn179:$eq179,5)
but whatever suits you. :)
 
Upvote 0

Forum statistics

Threads
1,216,187
Messages
6,129,396
Members
449,508
Latest member
futureskillsacademy

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