Formula to Count Number of Hours when Target is Hit (Target: 2700)

Prashant_91

New Member
Joined
Jun 1, 2021
Messages
6
Office Version
  1. 2016
Platform
  1. Windows
Hello Friends,

I need help calculating number of hours when the member hit the target of 2700. Below excel show multiple examples where all members (abc1, abc2,..) hit the target of 2700 after certain hours of work and 2 members (abc2 & abc7) are not able to hit the target.
So Ideally formula should provide the number of hours members took to hit 2700 total. If member is not able to hit 2700, then it should return 0 as an value. Also formula should exclude the blank cells and only count the cell which contain values (please do not remove blank cells).

1622597697878.png


I tried below formula but it is not giving me desired result.
=COUNT(OFFSET(B5,0,0,1,MAX(IFS(V5<2700,0,SUMIF(OFFSET(B5,0,0,1,COLUMN(B5:U5)-COLUMN(B5)+1),">0")<"2700",COLUMN(B5:U5)+1))-COLUMN(B5)+1))

Please help me with the formula which can give me correct hours only if target of 2700 is hit and which also exclude blanks.
 
In addition to above, below formula does give me desired correct result when target total is 2700 or above but it also count all the hours IF target total is less then 2700. If this can be modify in a way where it gives 0 when target total is less then 2700 than it would work.

=COUNT(OFFSET(B2,0,0,1,MAX(IF(SUMIF(OFFSET(B2,0,0,1,COLUMN(B2:U2)-COLUMN(B2)+1),">0")<=2700,COLUMN(B2:U2)+1,0))-COLUMN(B2)+1))

See below screenshot:
1622689608274.png


Apologies for multiples screenshots rather then miniexcel file.
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
below formula does give me desired correct result when target total is 2700 or above
Does it? I think it also gives an incorrect result when the total exactly equals 2700. Try changing O2 in that example from 375 to 374

Try this mix of the two approaches.

21 06 02.xlsm
ABCDEFGHIJKLMNOPQRSTUVW
112 AM1 AM2 AM6 AM7 AM8 AM9 AM10 AM11 AM12 PM1 PM2 PM3 PM4 PM5 PM6 PM7 PM8 PM9 PM10 PM
2abc1277366464388513794013753972588
3abc2192262531361124235407221693960
4abc3211287159161772583251371451373312521814014
Count (2)
Cell Formulas
RangeFormula
W2:W4W2=COUNT(B2:INDEX(B2:U2,MATCH(TRUE,SUMIF(OFFSET(B2,0,0,1,COLUMN(B2:U2)-COLUMN(B2)+1),">0")>=2700,0)))
 
Upvote 0
Solution
Maybe this regular formula
=COUNT(B2:INDEX(B2:U2,MATCH(TRUE,SUBTOTAL(9,OFFSET(B2,,,,{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}))>=2700,0)))
confirmed with just Enter

M.
 
Upvote 0
Thank you Peter and Marcelo. Both the above formula are working very well and gives the required output.
Thank you so so much for all the help :)
 
Upvote 0
You're welcome. Glad we could help. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,192
Members
449,072
Latest member
DW Draft

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