Count If Issue

russelgreen

New Member
Joined
Nov 21, 2012
Messages
18
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I'm trying to create an spreadsheet which counts certain words in a cell only once and gives me a total. I can do this but some of the words I'm searching for are part of another word that I'm searching (eg room and room service).

So this spreadsheet will look at company reviews and count how many times the key words are mentioned. How can search for one and it doesn't count as part of the other search?

Regards,

Russ
 
Firstly, you are not using the forum quote tags correctly. I fixed post 15 and 19 for you but quotes are for posting what has appeared in another post, not what you are currently writing. Post 19 looked like below before I edited it. It says "Peter_SSs said: ..." but in fact it is what you were saying, not me. ;)

View attachment 26006

The #NAME? error has two likely causes.
- You have not used the same spelling of the function name on the worksheet as it is in the code, or
- You have placed the code in the wrong place in the vba window.

So check both spellings carefully and review steps 1 to 3 in my instructions above.

Thanks for updating your profile. (y)
Thanks Peter, and sorry for the posting error...
So I've tried again and still nothing? Where would i find the function name to make sure it is the same as the code?
I believe that I placed the code in the correct place, but still nothing....
Sorry for being so thick...
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Sorry for being so thick...
No need to apologise when you are just getting started. :)

Placing the code: In the vba window (you can open it with Alt+F11 if it is not already open) find your project in the project explorer at the left and open out all the sections by clicking any + signs.
Mine is called russelgreen.xlsm and looks like below. If you have a Module 1 and double-click that do you see the code on the right like below?

1605269418078.png



To check spelling. The two highlighted items below (one in the vba window, one in the worksheet formula) should be the same

1605269522654.png


1605269556911.png
 
Upvote 0
No need to apologise when you are just getting started. :)

Placing the code: In the vba window (you can open it with Alt+F11 if it is not already open) find your project in the project explorer at the left and open out all the sections by clicking any + signs.
Mine is called russelgreen.xlsm and looks like below. If you have a Module 1 and double-click that do you see the code on the right like below?

View attachment 26007


To check spelling. The two highlighted items below (one in the vba window, one in the worksheet formula) should be the same

View attachment 26009

View attachment 26010
Thanks Peter,

Yes i see the code under Module 1 in the VBA project. The only thing I noticed that was different was you have something called Option Explicit at the top of your code and I don't? Spelling is the same on both...
 
Upvote 0
different was you have something called Option Explicit at the top of your code and I don't
That is not important in relation to this error. Is it possible that you could upload a sample workbook (with any sensitive data removed or disguised) with a small set of sample data and the formula entered into column D to say DropBox, OneDrive, Google Drive, etc and provide a shared link here?
 
Upvote 0
That is not important in relation to this error. Is it possible that you could upload a sample workbook (with any sensitive data removed or disguised) with a small set of sample data and the formula entered into column D to say DropBox, OneDrive, Google Drive, etc and provide a shared link here?
Thanks Peter,

move saved the item again and deleted and re I put the vba and it works a treat. Thank you so much for your help and time.

stay safe
 
Upvote 0
Solution

Forum statistics

Threads
1,214,589
Messages
6,120,416
Members
448,960
Latest member
AKSMITH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top