Using the numeric contents of a cell to define row number

J

JRD

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
 
N

Niek Otten

Hi John,

=COUNTIF(B1:INDIRECT("B"&A1),"PCI")

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


| 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
|
 

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