Advanced counting? or do I need VBA for this?

wigarth

Board Regular
Joined
Apr 16, 2016
Messages
51
Office Version
  1. 365
Platform
  1. Windows
[TABLE="width: 1000"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD][/TD]
[TD]week1
[/TD]
[TD]week2
[/TD]
[TD]week3
[/TD]
[TD]week4
[/TD]
[TD]week5
[/TD]
[TD]sum "ok" weeks
[/TD]
[TD]longest coherent period with OK
[/TD]
[TD] coherent status with "OK" backwards as of week 5
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Becky
[/TD]
[TD]ok
[/TD]
[TD]ok
[/TD]
[TD]failed
[/TD]
[TD]ok
[/TD]
[TD]failed
[/TD]
[TD]3
[/TD]
[TD]2
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]Sam
[/TD]
[TD]failed
[/TD]
[TD]failed
[/TD]
[TD]ok
[/TD]
[TD]ok
[/TD]
[TD]ok
[/TD]
[TD]3
[/TD]
[TD]3
[/TD]
[TD]3
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]John
[/TD]
[TD]failed

[/TD]
[TD]failed
[/TD]
[TD]failed
[/TD]
[TD]ok
[/TD]
[TD]ok
[/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]Paula
[/TD]
[TD]failed
[/TD]
[TD]ok
[/TD]
[TD]ok
[/TD]
[TD]failed
[/TD]
[TD]failed
[/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[TD]0
[/TD]
[/TR]
</tbody>[/TABLE]

This is a simplified table I am working on. Its the formulas in Column "H" and "I" that I am struggling with.

Goal of tableis to calculate which person has achieved goals each week. And to specify whohas done most weeks coherent “OK”


Column H: Goalis to count how many coherent weeks in a row a person has done “OK” at thehighest from week 1 to week 5… For Becky this is 2 (week 1 and week 2)

Column I: Goalhere is to count which person has the most coherent amount of weeks as of nowwith the result “OK” (So If we imagine being in week 5 now, we need to count coherentweeks with OK from week 5, then week 4, then week 3 etc…

I can't seem to get this sorted by myself. Anyone please suggest.

Best Regards:
Wigarth


 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
You'll need a protected data sheet to get this to work if you want to do it without VBA.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[TD]L[/TD]
[TD]M[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD][/TD]
[TD]week1[/TD]
[TD]week2[/TD]
[TD]week3[/TD]
[TD]week4[/TD]
[TD]week5[/TD]
[TD]week6[/TD]
[TD]week7[/TD]
[TD]week8[/TD]
[TD]week9[/TD]
[TD]week10[/TD]
[TD]week11[/TD]
[TD][/TD]
[TD]=MAX(B6:L6)[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Becky[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD]failed[/TD]
[TD]ok[/TD]
[TD]failed[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Sam[/TD]
[TD]failed[/TD]
[TD]failed[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD]failed[/TD]
[TD]ok[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]John[/TD]
[TD]failed[/TD]
[TD]failed[/TD]
[TD]failed[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD]failed[/TD]
[TD]failed[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Paula[/TD]
[TD]failed[/TD]
[TD]ok[/TD]
[TD]ok[/TD]
[TD]failed[/TD]
[TD]failed[/TD]
[TD]failed[/TD]
[TD]failed[/TD]
[TD]failed[/TD]
[TD]failed[/TD]
[TD]failed[/TD]
[TD]failed[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD]=IF(B2="ok", IF(C2<>"failed",IF(B2=C2,IF(A6>1,A6+1,2),1), 0),0)[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Drag the formula in B6 down and over
Drag the formula in N2 down.

That should give you what you want. Put the numbers from the If's into a data sheet and protect the formulas and this should work without VBA.
 
Upvote 0
First ofall, Thanks for the reply and thanks for the suggestion.
I reallyappreciate you taking the time to try and help.

Unfortunatelyit doesn’t work.

Becky comesout with 6 witch is correct, but Sam comes out with 2,4???
It was alot of “IF” in that formula. It seems like one of them is triggering wrong atsome point.

Best regards:
Wigarth

 
Upvote 0
Sorry! When pasting formula i missed one "," that should have been a ";" So when I fixed that it worked. Thank you so much.
 
Upvote 0

Forum statistics

Threads
1,224,455
Messages
6,178,772
Members
452,875
Latest member
Disastrouscoder

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