Hi guys!
I have been handed a piece of work that has me stumped. Essentially, there us a summary sheet for Sales that has various data on there like average weekly sales (per quarter, year) max sales and other items.
Item ............... Mathew ... Dean ... David ...
Ave QTR
Ave YR
Max WK
...
Consec Target
I have been asked to add to this summary an item which shows the number of consecutive weeks that each salesperson achieves a target. I immediately thought it was like a "Win Streak" like you see within sports, so I googled for that, found something that I thought I might be able to work with, but alas the code I found for a user defined function didn't take into account a lookup for salesperson, ie only asked for a range of cells to look at and the value you are looking for.
The data I have isn't sorted, is irregular (salesmen can be absent from work on certain weeks) and the new data is appended to the bottom of the list. An example:
Note that David is not in week 10, for instance.
What I would like is for a couple of items in the summary page; one showing the current "target streak", another for the best or maximum streak.
As the data can't be sorted, I have thought that this might be an array problem within some code, only bringing certain items into the array depending on whose name is at the top of the column in the summary sheet. However, I just can't get my head around how I can get this to work.
Any help would be greatly appreciated.
Thanks in advance,
Mooski.
I have been handed a piece of work that has me stumped. Essentially, there us a summary sheet for Sales that has various data on there like average weekly sales (per quarter, year) max sales and other items.
Item ............... Mathew ... Dean ... David ...
Ave QTR
Ave YR
Max WK
...
Consec Target
I have been asked to add to this summary an item which shows the number of consecutive weeks that each salesperson achieves a target. I immediately thought it was like a "Win Streak" like you see within sports, so I googled for that, found something that I thought I might be able to work with, but alas the code I found for a user defined function didn't take into account a lookup for salesperson, ie only asked for a range of cells to look at and the value you are looking for.
The data I have isn't sorted, is irregular (salesmen can be absent from work on certain weeks) and the new data is appended to the bottom of the list. An example:
Code:
Year Week Name Total
2010/11 7 Mathew 10
2010/11 7 Dean 10
2010/11 7 Stu 30
2010/11 7 Martin 40
2010/11 7 David 50
2010/11 7 Richard 10
2010/11 8 Mathew 30
2010/11 8 Dean 40
2010/11 8 Martin 10
2010/11 8 David 10
2010/11 8 Richard 20
2010/11 9 Mathew 10
2010/11 9 Dean 30
2010/11 9 Stu 40
2010/11 9 Martin 50
2010/11 9 David 10
2010/11 9 Richard 30
2010/11 10 Mathew 40
2010/11 10 Dean 50
2010/11 10 Stu 10
2010/11 10 Martin 10
2010/11 10 Richard 10
Note that David is not in week 10, for instance.
What I would like is for a couple of items in the summary page; one showing the current "target streak", another for the best or maximum streak.
As the data can't be sorted, I have thought that this might be an array problem within some code, only bringing certain items into the array depending on whose name is at the top of the column in the summary sheet. However, I just can't get my head around how I can get this to work.
Any help would be greatly appreciated.
Thanks in advance,
Mooski.