Steve_Brady
asked on
How do you put =LEFT() inside =COUNTIF() in Excel?
Hello,
How do you correctly put a =LEFT() function inside of a =COUNTIF() function?
For example, here's a formula I just tried (which obviously does not work):
=COUNTIF(LEFT(L4:L33963,2) ,L2)
My objective is to determine how many of the entries in the range begin with the two characters: "##" (i.e. not variables but two number signs) and have the result display in L3. Therefore, I entered "##" in L2 and the above formula in L3.
In other words, I don't want to count the cells whose complete entries are the same as L3 but only those whose first two characters are the same. To do that, it seems like there should be an equal sign in there somewhere saying, "if the first two characters in a given row equal the value in L2 then count that row" but I can't determine where it would go.
Sometimes these formulas just fall right into place and other times it seems as though there is a 12 inch block wall (full of grout) standing in the way! :p
Thanks
How do you correctly put a =LEFT() function inside of a =COUNTIF() function?
For example, here's a formula I just tried (which obviously does not work):
=COUNTIF(LEFT(L4:L33963,2)
My objective is to determine how many of the entries in the range begin with the two characters: "##" (i.e. not variables but two number signs) and have the result display in L3. Therefore, I entered "##" in L2 and the above formula in L3.
In other words, I don't want to count the cells whose complete entries are the same as L3 but only those whose first two characters are the same. To do that, it seems like there should be an equal sign in there somewhere saying, "if the first two characters in a given row equal the value in L2 then count that row" but I can't determine where it would go.
Sometimes these formulas just fall right into place and other times it seems as though there is a 12 inch block wall (full of grout) standing in the way! :p
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could also convert it to an array formula by confirming entry with Shift + Ctrl + Enter.
There are numerous trains of thought about array formulas, probably worth avoiding where there is another option.
Thanks
Rob H
There are numerous trains of thought about array formulas, probably worth avoiding where there is another option.
Thanks
Rob H
ASKER
Multiple helpful responses! Thanks
>>Thanks to barryhoudini for some great information....Very cool.
Not meant to embarrass him but FYI, Barry's answers are always accurate, always straightforward, always easy to follow and understand, and always include "great information." He is a good one to follow around!
Afterthought: perhaps "always" is a tad bit too strong -- I know Barry would say so -- so perhaps we should change them to "almost always" but if we do, note that the "tad" is a very small one indeed! :)
>>Thanks to barryhoudini for some great information....Very cool.
Not meant to embarrass him but FYI, Barry's answers are always accurate, always straightforward, always easy to follow and understand, and always include "great information." He is a good one to follow around!
Afterthought: perhaps "always" is a tad bit too strong -- I know Barry would say so -- so perhaps we should change them to "almost always" but if we do, note that the "tad" is a very small one indeed! :)
ASKER
Thanks
Thanks to barryhoudini for some great information. I never knew why certain things didn't work, I always just found work arounds. Very cool.