Thread: If Then formula
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
Sandy Mann Sandy Mann is offline
external usenet poster
 
Posts: 2,345
Default If Then formula

Using your idea:

=COUNTIF($A$2:$A$128,A2)-COUNTIF(A2:A128,A2)+1

Copied down all produces the numbers list when filtered.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Terry Tipsy" wrote in message
...
Try the 'COUNTIF' function. On the test data I used, I inserted a row
above
my filtered headings and entered this formula above the column I wanted to
count:
COUNTIF(F:F,F3)
This counted my filtered rows. Note: You must have the 'Iteration'
button
selected at Tools/Options/Calculation or you will get the 'circular
reference' error.

Now that you have the rows counted, you can refer to this cell to create a
formula to number the displayed rows and fill down. In my case I put
'=$F$1-(F1-1)' in the first cell and then '=$F$1-($F$1-1)+O3' in the
second
cell and thereafter. If desired, you would need to add to the formula to
check that the max count was not exceeded.

--
T Tipsy


"carrera" wrote:

I have a sheet that I auto filter by job title, i.e. Doctor, Nurse, Tech,
Admin.

With no auto filter on, the each person list listed by name, with the
column
next to their name designating them as 1 through 100.

If I auto filter for, let's say Nurse, of which there are 35, what
formula
can I put in the cell to the right of the name to number these people as
1
through 35?

In other words, the number would change depending on which rows were
visible
at the time.

The names on this list change on a regular basis.