I am looking for a formula which allows me to search a certain number of " " starting from the end of the text (RIGHT) in a text string in cell A, and then it looks what is on the RIGHT of the text string and search for that bit of text for exact match against a text range in another column text column B.
If exact match is found it should pick what is in corresponding column C and return that value. If more then one match is found in column B then an ERROR should be given.
I have following bit of code which looks at the 3rd space but doesn't return all of the text on the RIGHT hand side
=RIGHT(B8,SEARCH(" ",B8,SEARCH(" ",B8,SEARCH(" ",B8)+1)+1)-1)
and I still require the compare text formula to cell B and C.
Try:
=TRIM(RIGHT(SUBSTITUTE(B8," ",REPT(" ",777)),2331))
though I'm not at all clear about the other parts to your question. Perhaps you could give some examples?
Regards
Maybe try:
=IF(COUNTIF(B:B,RIGHT(A8,LEN(A8)-FIND(" ",A8,FIND(" ",A8,FIND(" ",A8)+1)+1)))>1,"ERROR",VLOOKUP(RIGHT(A8,LEN(A8)-FIND(" ",A8,FIND(" ",A8,FIND(" ",A8)+1)+1)),B:C,2,0))
and adjust the cell references if required.
Related
This is the problem i am facing in Excel formula
enter image description here
In column F, i want to find the common text across A2 to E2 (containing Blanks)
My Question:
Is there a simple way to get the result without VB?
Any help is appreciated,thanks
I found that google sheets has some really cool functions.
If you put the formula =SPLIT(A1, ",", TRUE,FALSE) in the cell after your row of common text (or probably even in a different sheet - "probably because hadn't tried it, though it should), the next x cells (where x is the number of "," in A1 - because "," is the delimitator) will be the text.
then you can put the code =IF(SUM(ARRAYFORMULA(if(REGEXMATCH($A$1:$D$1,F1),1,0)))=COUNTA($A$1:$D$1),F1,"") into an equal number of cells after that (probably should just put into the max number), and =CONCATENATE(I1:L1) into the last cell.
Ok. So to tweak this for yourself: I found that ARRAYFORMULA lets you put an array in place of a single cell in a function inside. how it exactly works I read its like a for loop. but I can't really vouch for that. but here it lets you have REGEXMATCH (which is a Boolean check on the cell you give it for if it contains the given REGEX) check each cell in the array.
the sum will add them up, and the if will match against the COUNTA to find if the number of cells in the array that contain this string is equal to the number of non-empty cells.
the concatenate at the end adds all the cells (containing the regex function) together, and since the only non-empty cells will be the one with the string, that is what this cell will return (no spaces).
code:
results:
the test data:
If you need in specifically Excel... this won't help.
We can use power query to achieve the desired result.
Unpivot the columns in Power query
Split all the columns by Comma delimiter
Create a custom column to see if the first column records exist in the remaining columns.
Use the functionText.contains.
Sample function: =Text.Contains([column.1],[column.1]&[column.2]&[column.3])
If the above function returns TRUE then get the first column result(This is the expected result) and load the data back to your excel
I apologize if this is a silly question, or if it's been asked before, but I have searched all over and haven't found a similar question/solution. I need to look within two possible columns (A and B) for text contained in another column (E). If text contained in column A or B is found within column E, I need the value in column C to appear in column F.
The text in column A and B will not be identical to that in column E (if it were I wouldn't be asking this question). And there may or may not be data in column B (not sure if that adds any complexity, but just for clarity).
I've tried all sorts of combinations of INDEX(MATCH and ISNUMBER(SEARCH, etc. but to no avail. I'm pretty sure there is a simple solution for this. Any help would be greatly appreciated!
You can use following array formula:
{=INDEX(F$2:$F$6,MATCH(1,--(MMULT(--ISNUMBER(SEARCH(IF(ISBLANK(B2),A2,A2:B2),$E$2:$E$6)),TRANSPOSE(COLUMN(IF(ISBLANK(B2),A2,A2:B2))^0))>0),0))}
Array formula after editing is confirmed by pressing ctrl + shift + enter
EDIT:
Reverse search - from column C to column F. Also an array formula.
{=INDEX($C$2:$C$9,MATCH(1,--(MMULT(--ISNUMBER(SEARCH(IF(ISBLANK($A$2:$B$9), $A$2:$B$9 & "#",$A$2:$B$9),E2)),TRANSPOSE(COLUMN($A$1:$B$1)^0))>0),0))}
In the expression $A$2:$B$9 & "#" instead of # you can specify any character that is not used in the search text
Not sure if there is an easier way, but with some validation you can easily come up with something like
=IF(OR(IF(A3<>"",ISNUMBER(SEARCH(A3,E3)),FALSE),IF(B3<>"",ISNUMBER(SEARCH(B3,E3)),FALSE)),C3,F3)
It verify that both A3 and B3 are not empty (<>"",...,FALSE) and return false if so.
It than make twice the same validation for A3 and B3; Search if the cell is contained within the cell E3.
If any of the two above is TRUE, than the whole IF is true, and it will return C3 as you need.
You didn't mention what you required in the case that the string was not found, so in my exemple, it return the value in F3 (but you could replace it with whatever).
Hope this help!
I have a column of text values (column C below), they are of varying length. I have a separate array of text values (column A below). I want a formula that will look through the strings in Column C and return the word from Column A that it matches. If there are multiple matches (rare, probably won't happen), it will only return one.
Please see my example:
Column D is the result I am looking for. As you can see, this will require some kind of fuzzy string matching. The word could appear anywhere in the cell. It doesn't need to be case sensitive. But I need it to pull that word out of the string as the result basically.
Thank you!
Use This:
=INDEX(A:A,AGGREGATE(15,6,ROW($A$2:$A$5)/(ISNUMBER(SEARCH($A$2:$A$5,C2))),1))
One more, slightly simpler:
=IF(COUNTIF($C$1:$C$100," * "&A2&" * ")>0,A2,"")
You can also try this formula =INDEX(A:A,SUMPRODUCT(MATCH(1,NOT(ISERR(SEARCH(A:A,C2)))*1,0))). Enter it using CTRL+SHIFT+ENTER since it is an array formula.
This formula seems to be working for me:
(Please use Ctrl+Shift+Enter for the array formula to take effect)
{=INDEX($A$2:$A$5,MATCH(1,COUNTIF(C2,"*"&$A$2:$A$5&"*"),0))}
Screenshot of Excel sheet
Example Data
I need to find anything in column B within the strings in Column A and output the cell in Column A in Column C.
I know if it is a short list I can do the highlight cell if a text contains x with Conditional Formatting. However, I have a long list of items that I need to check within the strings of another list.
Let me know if anymore detail needs to be provided. Any help is appreciated. Thanks.
Try this Array formula with wildcards:
=IF(ISNUMBER(MATCH(1, IF(ISNUMBER(SEARCH("*"&$B$1:$B$3&"*",A1)),1,0),0)),"Y","N")
It is an array and need to be confirmed with Ctrl-Shift-Enter.
The search area represented in this small example, $B$1:$B$3 when enlarged must be to the exact range of lookups or it will not return correct values.
You can do this with array formula, type the following in cell C1, then press Ctrl + Shift + Enter:
=INDEX(B:B,MATCH(TRUE,FIND(B:B,A1)<>"#VALUE!",0))
Drag it down column C to match number of rows in column A. You can then put a conditional formatting/filter to see what row in A has substring in B.
If you simply want a yes/no result, enter the following into D1:
=IF(COUNTIF(C1:C6,"<>0")>0,"Found","Not Found")
not even sure if this is possible in excel .
i want to compare all the rows in the column and get the count of them if the string contains "the"
so i know i can do this
=count(B0:B99)
is there a way to do B0- BN ? the count
(~df.col3.str.contains('u|z')).sum() found this trying to make this work so i know its possible now.
now can i only count them if b0- bn contain the string "the" . lets assume all the rows contain strings
my backup plan is exporting the data and writing a ruby script to do it but i feel like i should be
note everything is in column B
=SUM(IF(IFERROR(SEARCH("the ",B:B),0)<>0,1,0))
enter this as array formula by pressing Ctrl+Shift+Enter in formula bar.
Result should look like this:
{=SUM(IF(IFERROR(SEARCH("the ",B:B),0)<>0,1,0))}
This will count all cells which contain string "the" in your column:
=COUNTIF(B1:B99,"*the*")
Add an extra column (D) with formulas similar to =IFERROR(SEARCH("the",C1),0) in each cell where Column C contains the text you want to search, and add a summary formula =SUMIF(D1:D100,">0",B1:B100) to a single cell where Column B contains the numbers you want to sum.