Count (ifs) values above 0 in a Range

ILikeCakes

New Member
Joined
Apr 1, 2014
Messages
9
Hi guys,

I've been working on the for 3 days now and cannot find a solution.

what i need to achieve is the following

I need a formula to count (Paid Weeks) how many cells for each row have a value higher than 0, between the Week Ranges (Week 1_13 etc) in the top row, based on the "Start week" & "Current Week.

for example the first example started in Week 1_13 and has a value in each week until the current Week 8_13, which equates to 8 (Paid Weeks)

in the second example the start week is Week 3_13, and there is a value greater than 0 for 5 weeks up to the current week, which in this instance would equate to 5 (Paid Week)

I'm sure you get the gist by now.
the format below is near on identical to whats used in my workbook.

I have tried countifs, sumproducts, arrays, but i cannot get this to work correctly.

the below countifs is the closest i have come but in areas it counts the Week Ranges instead of the intended row.

D10 represents the Start week of Row
D7 is the current week.

=COUNTIFS(H10:O10,">0",H9:O9,">="&D10,H9:O9,"<="&D7)


current weekWeek 8_13
nameStart datestart weekPaid
Weeks
Week 1_13Week 2_13Week 3_13Week 4_13Week 5_13Week 6_13Week 7_13Week 8_13
ExampleWeek 1_13811111111
ExampleWeek 3_135111011
ExampleWeek 7_1311
Example

<tbody>
</tbody>


Thanks in advance for anyone able to help on this one. I'm sure it's something simple but i just cant get my head around it.

Thanks again
 
Thanks this is brilliant.

I have added in the rows suggested for year and week. what sort of formula would we being looking at using for this??


Thanks
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Assuming your years are in row 7 and week numbers in row 8, start date is in D10, current week is in D7, weekly data starts from column H. Enter the following array formula (confirm with ctrl+shift+enter):

PHP:
=SUM(OFFSET($G10,0,MATCH(RIGHT($D10,2)+2000&MID($D10,6,FIND("_",$D10)-6),$H$7:$DG$7&$H$8:$DG$8,0),,MATCH(RIGHT($D$7,2)+2000&MID($D$7,6,FIND("_",$D$7)-6),$H$7:$DG$7&$H$8:$DG$8,0)-MATCH(RIGHT($D10,2)+2000&MID($D10,6,FIND("_",$D10)-6),$H$7:$DG$7&$H$8:$DG$8,0)))
 
Upvote 0
Hi

Tried this but as you can see from the results below, the calculations are incorrect. I have tried to amend this but failed.
Thanks again for all your help. Greatly appreciated





Week 14_14Year20132013201320132013201320132013201320132013201320132013201320132013201320132013201320132013201320132013201320132013201320132013201320132013201320132013201320132013201320132013201320132013201320132013201320132014201420142014201420142014201420142014201420142014201420142014201420142014201420142014201420142014201420142014201420142014201420142014201420142014201420142014201420142014201420142014201420142014201420142014
Week1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515212345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
WeeknumLOSPaid WeeksAWR?Week 01_13Week 02_13Week 03_13Week 04_13Week 05_13Week 06_13Week 07_13Week 08_13Week 09_13Week 10_13Week 11_13Week 12_13Week 13_13Week 14_13Week 15_13Week 16_13Week 17_13Week 18_13Week 19_13Week 20_13Week 21_13Week 22_13Week 23_13Week 24_13Week 25_13Week 26_13Week 27_13Week 28_13Week 29_13Week 30_13Week 31_13Week 32_13Week 33_13Week 34_13Week 35_13Week 36_13Week 37_13Week 38_13Week 39_13Week 40_13Week 41_13Week 42_13Week 43_13Week 44_13Week 45_13Week 46_13Week 47_13Week 48_13Week 49_13Week 50_13Week 51_13Week 52_13Week 01_14Week 02_14Week 03_14Week 04_14Week 05_14Week 06_14Week 07_14Week 08_14Week 09_14Week 10_14Week 11_14Week 12_14Week 13_14Week 14_14Week 15_14Week 16_14Week 17_14Week 18_14Week 19_14Week 20_14Week 21_14Week 22_14Week 23_14Week 24_14Week 25_14Week 26_14Week 27_14Week 28_14Week 29_14Week 30_14Week 31_14Week 32_14Week 33_14Week 34_14Week 35_14Week 36_14Week 37_14Week 38_14Week 39_14Week 40_14Week 41_14Week 42_14Week 43_14Week 44_14Week 45_14Week 46_14Week 47_14Week 48_14Week 49_14Week 50_14Week 51_14Week 52_14
Week 44_13#N/A15201020202020202020202015202020202010202020
Week 37_131216040404040404040404050516255535421304040344041454040404040401
Week 45_13840453940535951533030404040404030304040404020
Week 45_1382045404040445160303040404004050454045404020
Week 44_1394445405045505556503030502238405042254050475040
Week 37_131040121427320001504040324040404040404040515551503030254028332020204040253020
Week 32_131305323940444650503450404050400504050555360102002040414140204040304060
Week 43_1397204043405040616053601020404040414139454040404050
Week 47_137305505553501120404040414040404040404045
Week 43_13881453440404550415353303040402530404645372374040
Week 40_131006305040403045405051604660303040402002040404045404040
Week 40_1391440304040404030245044574502020403530040454050354040
Week 32_1312854040404440483240404040404045404530605252303030404020414640200204040
Week 45_1381525504050595250303039404040404030404004040
Week 45_1380225504050555251303030354040404030454004040
Week 46_1374154050565450282940404030404040404004040
Week 41_1393704020404040404050545450202940414040404020040404040
Week 42_1397354040404040505554532829414037404244354041404060
Week 30_131485272840404037404040324040454035454848505554502827504045304548484046483840
Week 47_137335505654551539404040404040253540404040
Week 47_137515516054422839414041414140382541364051
Week 47_137315505554402839404040404040404040404020
Week 24_13135516308323232323232243226323232324033304040254035403352301339304020402020404040404040
Week 43_13910540404045505554503839303032404046374040404040
Week 32_13135440404041484046404036403511404046555150601624404034352440403650504047
Week 37_1312373636425040404040404046556050583030404040404040404046404850
Week 30_131317164024243632424844483031405050305050555555472823351840341040402535402034
Week 44_1373854040405355404027253140343035374040004048
Week 47_137315505554402839404040404040404040404020
Week 48_13653265552514040402040304136404020303220

<colgroup><col span="3"><col><col span="9"><col span="43"><col span="9"><col span="43"></colgroup><tbody>
</tbody>
 
Upvote 0
I can't upload anything as I can't install Excel Jeanie on my work pc. When I get home this evening I'll upload the solution for you.
 
Upvote 0
the formula is suming the values not counting. other than that it does exactly what it says on the tin :)

In the example data you provided, the values were only 1 or 0, hence no difference between summing or counting! You can easily change it to a COUNT function if you want.
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,790
Members
451,589
Latest member
Harold14

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