View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student
 
Posts: n/a
Default counting number of times value is greater than previous week

If your data is in A1 thru G1, then in B2 enter:

=IF(B1A1,1,0) and copy across. The sum of row 2 is your answer.

to get the other case use =IF(B1<A1,1,0)
--
Gary''s Student


"tereasajw" wrote:

Need to be able to count the number of times the value is greater than the
previous week value in a row of numbers:
15, 13, 15, 14, 16, 17, 18
This would show a 4 as in for 4 weeks we were on an upward trend.

Then have to do the reverse for downward trends - on the same row of numbers.
15, 13, 15, 14, 16, 17, 18, 15, 14, 13
say 3 weeks later this would show downward trend for 3 weeks.

Could be 2 separate formulas. Any help would be appreciated - using a
massive if statment right now that only allows me to go back about 6 weeks -
so if the trend last longer than 6 weeks, I keep showing a 6 for the
following weeks. Trying to stay away from macros if possible.