I have the following in my first 3 columns of my sheet in excel:
Results table. C3 is where I want the concatenation done
I also have the following table:
Now I am trying to use concatenate to retrieve the items from table 69 using the following conditions:
Spec = the value in B1 (Yellow in first photo)
Slot = each of the values in column A (A2:A18)
this is the formula I have in C2:
=CONCATENATE(IF(AND(Table69[Spec]=$B$1;Table69[Slot]=A2);Table69[Item];"")& ",")
Can anybody help me with this as this formula for the moment is returning as if there was no values?
Try using commas instead of semicolons. Once you do that your formula should return "Icon of the Silver Crescent,".
As a side note, the ampersand "&" sign will do the same thing as the concatenate formula. You are adding a comma at the end of your function.
I found an answer using Text join.
Thank you all that took the time.
=TEXTJOIN(", ";TRUE;IF((Table69[Spec]=$B$1)*(Table69[Slot]=A2);Table69[Item];""))
Related
I am trying to create an output in excel based off the number of words in cells. Essentially i want to check if the sum of the words in 3 cells is = 1,2 or >=3. Im using the len formula which i have successfully used on single cell conditions but im struggling to create the formula that would check multiple cells.
Below is an example of my data:
Column A Column B Column C
Cat;dog Bird
Formula
=SUMIF(AND(LEN(TRIM(A4))-LEN(SUBSTITUTE(B4," ",""))+1, LEN(TRIM(C4))-LEN(SUBSTITUTE(C4," ",""))+1, >=3), "Titanium")
https://docs.google.com/spreadsheets/d/1W6nFr-W0r-XWZnvrFWndsvdBEEGHMQUa/edit?usp=sharing&ouid=103068518904190156690&rtpof=true&sd=true
First I made a single formula to work on a single cell. It ignores semicolons and commas to calculate total words. That formula is in column F and it's:
=IF(LEN(E5)=0;0;LEN(TRIM(SUBSTITUTE(SUBSTITUTE(E5;";";" ");",";" ")))-LEN(SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(E5;";";" ");",";" "));" ";""))+1
Notice I added an IF to make sure that blank cells will count as 0 words (because the +1 will be added wrongly and we need to avoid this.
Now you just need to sum up all results and we get 8 words.
What you want is to get this result with a single formula and that can be perfomed with array formulas. In cell F11 my formula is:
=SUM(IF(LEN(E5:E8)=0;0;LEN(TRIM(SUBSTITUTE(SUBSTITUTE(E5:E8;";";" ");",";" ")))-LEN(SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(E5:E8;";";" ");",";" "));" ";""))+1))
You need to introduce this formula pressing CTRL+ENTER+SHIFT or it won't work!
Now you got the result in a single formula and you just need to add your conditions mentioned in your post
UPDATE: In your Google Sheets, the correct formula would be:
=ArrayFormula(IF(SUM(IF(LEN(TRIM(A3:B3))=0,0,LEN(TRIM(A3:C3))-LEN(SUBSTITUTE(A3:C3," ",""))+1))>=3,"Good","Bad"))
Please, notice Excel is not the same as Google Sheets so sometimes the formulas may be different in one of them.
I am Looking to concatenates multiple cells into one by Index-matching the criteria
The below formula is not pulling in all the required UPCs against the specified criteria
=INDEX($B:$B,MATCH($D:$D,$A:$A,0))
I would like the end result to look like COL E2 in the below image with semi-colons in between every value ;
Any help here would be much appreciated.
If you have Office365 then use TEXTJOIN() with FILTER() function.
=TEXTJOIN(";",TRUE,FILTER($B$2:$B$15,$A$2:$A$15=D2))
Edit: Assuming you don't have access to O365 dynamic formulas. Then try below array formula.
=TEXTJOIN(";",TRUE,IF($A$2:$A$15=D2,$B$2:$B$15,""))
Press CTRL+SHIFT+ENTER to evaluate the formula as it is an array formula.
An alternative approach using the CONCAT function:
=CONCAT(FILTER(B:B, A:A=D2)&";")
Explanation:
The FILTER logic is just like Harun24HR suggested. Creating an array of all the values in B where the value in A is equal to D2.
The & operator works on each element in the array and adds a delimiter ";" to each value.
Finally, the CONCAT function combines all of the elements in the array into a single string.
Is there a way to extract multiple strings between specific characters in excel and separating them with a comma.
For example:
I am thankful for every help!
The following requires a version of Excel O365 that supports dynamic arrays and the LET function.
If I understand correctly you are looking for something like this.
This formula will list all the positions of all [ in the string using dynamic array functions.
=LET(x,$B$2,
y, SEQUENCE(LEN(x)),
raw, IF(MID(x,y,1)="[",y,""),
filtered, FILTER(raw,raw<>"",""),
filtered)
LET allows you to set names within a formula using parameter pairs. The first is the name; the second is the value of the name. The last parameter is the value returned. In this case, x is set to cell B2. y is set to the array listing the numbers from 1 to the length of x using the dynamic array function SEQUENCE. raw is a list that shows the value of y if that position is [, otherwise it is blank. filtered uses the FILTER function to remove all of the blank rows. filtered is the last argument of the LET function so that is what is returned. If this formula is entered into cell A4 then A4 will show 1, A5 will show 14 and A6 will show 28.
If you then enter a similar formula in B4 replacing [ with ] then the result is {7,21,35} in cells B4, B5 and B6.
Finally, in cell B2 you can enter =TEXTJOIN(", ",TRUE,MID(A2,A4#+1,B4#-A4#-1)). This will return the result you are looking for.
If you are unfamiliar with dynamic arrays, A4# indicates an entire dynamic array starting in cell A4. In this case, it is the same as A4:A6.
More information on Dynamic Arrays
More information on LET
You can't do it with only formulas in Excel 2007. You need VBA UDF then. With Excel O365 having dynamic formula access, this can be done like:
=TEXTJOIN(", ",TRUE,TRIM(LEFT(FILTERXML("<t><s>"&SUBSTITUTE(SUBSTITUTE(A1,"]",REPT(" ",100)),"[","</s><s> ")&"</s></t>","//s[starts-with(., ' ')]"),100)))
Considering that you are using too old version of excel which lacks dynamic array functions and besides too many other useful functions, You may probably have to do a long workaround here.
First using substitute and len You have to find out number of such square parenthesis in each of the row. Thereafter you have to work out the formula of max of such numbers.
Do it like this
Assuming your text-values in A2 for a max of 4 occurrences enter the following formula in B2
=SUBSTITUTE(TRIM(REPLACE(LEFT(A2,FIND("]",A2&"]")-1),1,FIND("[",A2&"["),"")&" "&REPLACE(LEFT(A2,FIND("#",SUBSTITUTE(A2&REPT("]",2),"]","#",2))-1),1,FIND("#",SUBSTITUTE(A2&REPT("[",2),"[","#",2)),"")&" "&REPLACE(LEFT(A2,FIND("#",SUBSTITUTE(A2&REPT("]",3),"]","#",3))-1),1,FIND("#",SUBSTITUTE(A2&REPT("[",3),"[","#",3)),"")&" "&REPLACE(LEFT(A2,FIND("#",SUBSTITUTE(A2&REPT("]",4),"]","#",4))-1),1,FIND("#",SUBSTITUTE(A2&REPT("[",4),"[","#",4)),"")), " ", ", ")
Let's say this is the text in A2
I have a text [123] and some more [4523] and also [552222] how to extract [22]?
This will create a output of 123,4523,552222,22 in B2
There is no "extraction" in your question, just removal. The formula below replaces the unwanted characters with "", thereby removing them. Please try it.
=SUBSTITUTE(SUBSTITUTE(A2,"[",""),"]","")
Struggling to do this in Python so trying Excel formula.
these are the logic steps I would like to do:
Convert both columns to lowercase
if keyword matches any cell/s in the data string data string then identify the keyword and data string match and and put in another cell.
If there are no matches for the keyword then can put not found
How can I do this?
input example below: (as you can see data strings can be in any order)
output example:
output example:
Thank you!
Based on your revisions...
You will need to type the correct value for d2. Then in d3 and going down, you can use this formula.
=IF(OR(SUM(--ISNUMBER(FIND(D2,$B$2:$B$7)))=COUNTIFS($D$1:D2,D2),SUM(--ISNUMBER(FIND(D2,$B$2:$B$7)))=0),INDEX($A$2:$A$7,MATCH(D2,$A$2:$A$7,0)+1),D2)
Then in e2 and going down, you can use this formula
=IFERROR(INDEX($B$2:$B$7,SMALL(IF(ISNUMBER(FIND(LOWER(D2),LOWER($B$2:$B$7))),ISNUMBER(FIND(LOWER(D2),LOWER($B$2:$B$7)))*ROW($B$2:$B$7)-1),COUNTIFS($D$1:D1,D2)+1)),"not found")
Remember to enter both of the formulas with control + shift + enter
I have a column in Excel that contains a series of comma delimited values. The number of values in each row is different and the values I'm searching for can be in different positions within the cell. I would like to remove some of those values based on based on a string part.
Example cell:
2006CE3, 2007CE3, 2012CE1, 2012CE3, 2013CE1, 2013CE3, 2014CE2, 2015CE3, 2016CE2, 2019FA, 2020SP
Specifically, remove all values containing "CE". In the example above, I would like to remove 2006CE3, 2007CE3, 2012CE1, 2012CE3, 2013CE1, 2013CE3, 2014CE2, 2015CE3, 2016CE2, and leave 2019FA, 2020SP
To do this with a formula one will need TEXTJOIN:
=TEXTJOIN(", ",TRUE,IF(ISNUMBER(SEARCH("CE",FILTERXML("<z><y>"&SUBSTITUTE(A1,",","</y><y>")&"</y></z>","//y"))),"",TRIM(FILTERXML("<z><y>"&SUBSTITUTE(A1,",","</y><y>")&"</y></z>","//y"))))
Please try this formula solution of which using TEXTJOIN function available for Office 365
In B2, enter formula :
=TEXTJOIN(", ",1,INDEX(FILTERXML("<a><b>"&SUBSTITUTE(A2,", ","</b><b>")&"</b></a>","//b[not(contains(.,'CE'))]"),0))