Thread: Counting!
View Single Post
  #3   Report Post  
Alan Beban
 
Posts: n/a
Default

Rob Gould wrote:
Hi all,

I have some data which has been imported into Excel and is thus not
laid out in the best way. So what I get is Customer number in A1,
Customer name in B1. Below the Cus number are blank cells until the
next customer. Below B1 are dates on which sales where made to the
customer, until the next Customer name is reached. There are obviously
different numbers of rows of data for each customer.

I want to be able to count the number of dates under each customer.
For example I wish to know that ABC Customer purchased on 10 occasions
during a month.

Is there any way to do this quickly with the data laid out as it is? I
would prefer the result to be in the cell next to the customer name,
but elsewhere is fine if it can be done.

Thanks

Rob

In an available column, say Column J for this illustration, in J1 enter

=IF(AND(ISBLANK(A1),NOT(ISBLANK(B1))),OFFSET(J1,-1,0),A1) and fill down
as far as required;

then in C1 enter

=IF(NOT(A1=""),COUNTIF(J:J,J1)-1,"") and fill down as far as required.

This assumes that you do not thereafter insert rows except by importing
the whole range of new data.

Alan Beban