COUNTIF (complex) - Google Sheets

rlong98

New Member
Joined
Dec 6, 2019
Messages
11
Office Version
  1. 365
  2. 2016
  3. 2013
Platform
  1. Windows
  2. Web
Hello,

I'm puzzled on this one

I have a formula in Conditional Formatting
VBA Code:
=NOT(ISERROR(FIND(LOWER(A5),LOWER($B$1))))

Capture1.PNG

This works when I type in a phrase in B1 and it will Highlight all that have some or more of that phrase

GOAL - I want to use that same code in an COUNTIF

Code:
=COUNTIF(A5:A30,NOT(ISERROR(FIND(LOWER(A4),LOWER($B$1)))))

I would think that if the first code line works in Conditional Format and highlights the cells, that I could use it in a COUNTIF

Capture.PNG

I keep getting 0

Thank you!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
The conditional formatting formula returns either TRUE or FALSE, so the COUNTIF formula is counting cells that contain TRUE or FALSE, not cells that are comparable to the content of A4 or B1.

FYI if you use SEARCH instead of FIND then you don't need to convert to lower case to compare.
GOAL - I want to use that same code in an COUNTIF
that is not a goal, it is an impossible task, you might be able to achieve similar with sumproduct instead of countif, but without some indication as to what you're trying to do instead of how you're trying to do it we have little chance of guessing what you actually need.
 
Upvote 0
@rlong98 Your post has been reported as being cross posted with another site.

While we do allow Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.

Please provide the link(s)
 
Upvote 0
Thanks Jason
Sorry for the confusion

What I was attempting, is someone already has a workbook when they type in a title in the cell B1, the conditional format highlights all the cells that have the first word or both. So there can be 1:more highlighted.
What I was looking to do is get the total number the conditional format highlighted.
I figured since it was a FIND formula that it would work in a COUNTIF, but it doesn't.

Thank you for the reply
 
Upvote 0
That will be quite simple to solve, however I will not be doing so until provide the links to your cross posts.
 
Upvote 0
 
Upvote 0
Thank you! Thanks for the Rule Reminder - - I do have brain damage

Do you happen to know why in Google Sheets - ONE Workbook it works perfectly, and in another Workbook it give a Parse Error? As if something is blocking the Function from working.

Found it - (can't delete this msg) - but I still don't know "why"

In the other workbook I had to use semicolon instead of comma
(don't know why)
 
Last edited:
Upvote 0
In the other workbook I had to use semicolon instead of comma
In excel that is down to regional settings, semicolons are used in countries where decimal numbers use a comma in place of a dot / period. It is based on your system settings, so wouldn't vary between workbooks.
As google sheets is online, it could be based on the origin of the workbook instead, this is just a theory, not something that I know for certain as I have never used google sheets.
 
Upvote 0
Do you happen to know why in Google Sheets - ONE Workbook it works perfectly, and in another Workbook it give a Parse Error? As if something is blocking the Function from working.

Found it - (can't delete this msg) - but I still don't know "why"

In the other workbook I had to use semicolon instead of comma
(don't know why)

FYI for those watching: RE: Google Sheets
When looking at the document - found out the Language Setting was "German" which apparently changes the use of "," to ";" in formulas.
- Why I get Parse Errors still in that document is beyond me - but could be something in the Language concept? When I recreated it in a US / En - everything works
 
Upvote 0

Forum statistics

Threads
1,223,666
Messages
6,173,666
Members
452,527
Latest member
ineedexcelhelptoday

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