ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Count number of times a text occurs (https://www.excelbanter.com/new-users-excel/205981-count-number-times-text-occurs.html)

Lee

Count number of times a text occurs
 
I want to count the number of times a text occurs in a range and then put
1,2,3,ect in a cell adjacent to the occurance.
Apple 1
Apple 2
Apple 3
Apple 4
Banana 1
Banana 2
Banana 3
I can use the count function but it doesn't seem to help with the numbering.
It seems like it should be simple but it probably isn't.
Thanks for any help.


--
Lee



Don Guillett

Count number of times a text occurs
 
Try this, copied down
=COUNTIF($H$2:H2,H2)
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Lee" wrote in message
...
I want to count the number of times a text occurs in a range and then put
1,2,3,ect in a cell adjacent to the occurance.
Apple 1
Apple 2
Apple 3
Apple 4
Banana 1
Banana 2
Banana 3
I can use the count function but it doesn't seem to help with the
numbering. It seems like it should be simple but it probably isn't.
Thanks for any help.


--
Lee




Lee

Count number of times a text occurs
 
Thanks, it works very well. I don't understand why but it does work.
Thanks,
Lee

"Don Guillett" wrote in message
...
Try this, copied down
=COUNTIF($H$2:H2,H2)
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Lee" wrote in message
...
I want to count the number of times a text occurs in a range and then put
1,2,3,ect in a cell adjacent to the occurance.
Apple 1
Apple 2
Apple 3
Apple 4
Banana 1
Banana 2
Banana 3
I can use the count function but it doesn't seem to help with the
numbering. It seems like it should be simple but it probably isn't.
Thanks for any help.


--
Lee






Don Guillett

Count number of times a text occurs
 

Glad to help
The $h$2 anchors at the first cell to count. Then you look from there down
and check each cell against that.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Lee" wrote in message
...
Thanks, it works very well. I don't understand why but it does work.
Thanks,
Lee

"Don Guillett" wrote in message
...
Try this, copied down
=COUNTIF($H$2:H2,H2)
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Lee" wrote in message
...
I want to count the number of times a text occurs in a range and then put
1,2,3,ect in a cell adjacent to the occurance.
Apple 1
Apple 2
Apple 3
Apple 4
Banana 1
Banana 2
Banana 3
I can use the count function but it doesn't seem to help with the
numbering. It seems like it should be simple but it probably isn't.
Thanks for any help.


--
Lee








All times are GMT +1. The time now is 12:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com