Counting weeks the number of cells between the first and last nonblank cell

afarcet

New Member
Joined
Mar 26, 2009
Messages
5
I'm stuck. I can't find a way to crack this, should be simple.

I have a table with
Rows: customers
Columns: weeks

The data represents the number of orders each customer has made each week (0 and up).

I need to determine the average number of weeks of 'activity' (i.e. purchasing) per customer from first to last order. In other words the number of cells between the first non-zero and the last non-zero, knowing that there may be many weeks between one purchase and another, then more blanks, then more purchases, etc.

Thank you.
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Thanks :), but that returns the total number of weeks in which there was an order. Useful. But I need the time elapsed in weeks between the first and last order (no matter if the orders have been continuous or broken up over time).

Is that clear? :confused:
 
Upvote 0
Try this formula for the number of weeks between the first number and the last

=MATCH(9.9E+307,2:2)-MATCH(TRUE,INDEX(2:2<>"",0),0)
 
Upvote 0

Forum statistics

Threads
1,214,986
Messages
6,122,611
Members
449,090
Latest member
vivek chauhan

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