View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default counting numbers??

On Tue, 22 Jan 2008 18:32:39 +0000, bouncebackability
wrote:


probably not a suitable title...

ok my problem should be simple to explain.

i have in column B (from cells B2 to B20) 8 asterisks randomly
placed(*)

what i want to do is in column A (A2 to A20), the first time that the
star appears to write a '1' in the relative cell next to it, the second
time it appears in the list a '2' the third time a '3' and so on...
sounds simple and i thought it was. but im stumped. and dont know what
to search for on here sorry :(

thanks for any help



This assumes that the cell in column B will be either empty (blank), contain a
null string, or contain an asterisk.

A1: =IF(B1="","",COUNTIF($B$1:B1,"~*"))

Fill down to A20
--ron