counting first entry on a line

S

Sanford

I have customer data and want to count the nuber of new
customers each month.
The data look like:
Jan Feb Mar Apr May Jun
Cust1 12 2 3
Cust2 3 2 6
Cust3 2 5 3
Cust4 1

There are 2 new customers in Feb (first month of use), 1
in Apr and one in Jun.
I can do this by creating a bunch of new columns, noting
there where the first month of use occurred, and then
adding up the new columns; but that seems awkward.

Anything more elegant available?

Thanks
Sanford
 
J

Jason Morin

There's probably a more elegant way:

=SUM((COUNTIF(INDIRECT("B"&ROW(rng)&":"&CHAR(64+MAX(IF
(B1:G1=N1,COLUMN(B1:G1))))&ROW(rng)),">0")=1)*1)

Array-entered (meaning press ctrl/shift/enter), where:

1) your headers Jan-Jun are in B1:G1
2) your month to specify is in N1
3) "rng" is the range for the data (B2:G5 in this case)

HTH
Jason
Atlanta, GA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top