"*"&$ATU$3&"*" Dilema

WildWill

Board Regular
Joined
Sep 10, 2009
Messages
92
I have the following examples of text entries in a data table:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
G. Marcus-MRC<o:p></o:p>
P. Davis-GLTA<o:p></o:p>
B. Strauss-MRC<o:p></o:p>
<o:p></o:p>
The data would typically indicate an individual's Initial and Surname always followed by a "-" (no spaces) and a 3-digit uppercased Mnemonic representing his company's name. I am using the following formula to calculate the totals of cells which relate to a specific company: <o:p></o:p>
=COUNTIF($B34:$ATE34,"*"&$ATU$3&"*") where in this example, cell ATU3 would be a holding cell containing (e.g.) "MRC", and then the answer would be returned as "2" for the list provided above. <o:p></o:p>
<o:p></o:p>
....however, I am getting data errors and things don't seem to add up. Is there a chance that the formula that I am using is simply looking for occurrences of (e.g.) "MRC" in a string of text, and that it will return all those occurrences regardless of capitalisation and/or a prefix of a "-"?<o:p></o:p>
<o:p></o:p>
I think that perhaps I need a derivative of the formula above which will search SPECIFICALLY for "MRC", but only if it preceded by a "-" with no spaces? For example, if I had "G. Marcus-MRC" an a cell and I entered "ARC" in the holding cell (ATU3 above), then I would a count of "1" because the formula is finding the string "arc" in the word Marcus...whereas what I want to count is all the occurrences of "ARC" only where preceded by a prefix of "-" with no spaces. <o:p></o:p>
<o:p></o:p>
Is there a way that I can modify the formula to find what I am looking for?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hello, May be

=SUMPRODUCT(--ISNUMBER(SEARCH(ATU3,A1:A100)),--ISERROR(SEARCH(ATU3&"* ",A1:A100)))
 
Upvote 0
Hi Haseeb

That does not seem to be the solution - it returns similar number to what I was getting with the original formula - thanks anyway!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,726
Members
452,939
Latest member
WCrawford

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