View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Teethless mama Teethless mama is offline
external usenet poster
 
Posts: 3,718
Default Using the numeric contents of a cell to define row number

=COUNTIF(B1:INDEX(B:B,A1),"PCI")


"JRD" wrote:

Can anyone tell me whether I can put a number in a cell and then use that
cell to define a range

e.g.

A B
1 3 CABG
2 PCI
3 CABG
4 PCI

=countif(B1:B(A1), "PCI")

The answer should equal 1

Thanks

John