How to get unique value in single field of excel?
example: I have field AS "A2" which contain the value as "MAH, MOP, MHD, MAH, MHD" , I want to get unique value AS (MAH, MOP, MHD) in same field i.e "A2"
There is a similar query resolved at stackoverflow.
Have a look at the following url.
Hopefully you should be able to resolve your problem with this.
Extract unique characters from cells containing comma separated text
Hope this Helps.
Related
I need to update hundreds of cells, and that would be trivial automating, but I am not being able to make it work.
I have a list like the following:
And, in a different tab, a list I have to populate with values above (in B) based on the appearance of the twitter handle in other column.
The names are within a long text string (all of them begin with #), and it is not possible to re-order the list based on those names. Also, there are more names than values, so some cells will remain blank.
Is there a way I can write a formula that writes the values of the first list into the second one if the name in column A in that row is contained within the adjacent string?
Thanks!
You can refer to this sample formula (Same sheet was used):
=arrayformula(if(C2:C<>"",iferror(vlookup(REGEXEXTRACT(C2:C,"\B\#\w+"),A2:B,2,false),""),""))
What it does?
Use array formula to loop column C values
Extract the twitter name (string that starts with #) using Regexextract()
Use the extracted #twittername as search key to get the connections value using vlookup()
Output:
Since we don't have access to the spreadsheet, I can't know for sure what the line-break character is within the Col-A cells of your second sheet. And using this line-break character is important, since Twitter handles may use some non-alphanumeric characters such as the underscore and others which are not included in such REGEX notation as \w. I'm assuming here that the line-break character is CHAR(10) from the ASCII chart.
I also don't know the name of your first sheet; so here, I've just written it as Sheet1. You'll need to replace that with your actual sheet name, remembering to place it in single quotes if it contains anything but alphanumeric characters (e.g., 'Data Sheet').
That said, delete everything from Col-B in your second sheet (including the header "Connections") and place the following formula in cell B1 of that second sheet):
=ArrayFormula({"Connections"; IF(A2:A="",, IFERROR(VLOOKUP(REGEXEXTRACT(SUBSTITUTE(A2:A,CHAR(10),"~"),"#[^~]+"),Sheet1!A:B,2,FALSE)))})
I have a column of concatenated values that include airport codes within the text. I have a separate list of 39000 airport codes. I need to search each concatenated field for any of those airport codes and, if an exact match is found, display it in the field with the formula.
For example, I need to search the text in the left column here for any airport code in my list, which includes KATL. It then returns the values on the right via my formula:
There will never be more than one match.
The formula is below, which I've used elsewhere. The problem is that the formula is returning the last partial match... for example, in my airport list I have KATL, KATO, and KATS. Even though the sentence HAS KATL, the formula is returning KATS (last partial match).
=INDEX(reference!$G$2:$G$39170,LARGE(IF(ISNUMBER(SEARCH(reference!$G$2:$G$39170,SageReportData1!$P613)),ROW(reference!$G$2:$G$39170)),1))
reference!$G$2:$G$39170 = airport code array/column
SageReportData1!$P613 = the data cell with KATL I'm searching now
How can I tell this formula to give me the best match with the most characters that don't have spaces?
Thanks,
Rick
Found the answer, slightly modified version of my formula.
=INDEX(reference!$G$2:$G$39170,MAX(IF(ISERROR(FIND(reference!$G$2:$G$39170,SageReportData1!$P13)),-1,1)*(ROW(reference!$G$2:$G$39170)-ROW($G$2)+1)))
I have a bunch of data that consist of Id Number and Names.
Image 1
{=IF(ISERROR(INDEX($A$2:$B$12;SMALL(IF($A$1:$A$16=$E$1;ROW($A$1:$A$12));ROW(1:1));2));"";INDEX($A$1:$B$12;SMALL(IF($A$1:$A$16=$E$1;ROW($A$1:$A$12));ROW(1:1));2))}
Previously (Image 1) I successfully able to return multiple value with A Name value from column Names that consist of only one name. I am using Index function Array formula to solve this problem.
But,I got stuck when I have multiple names in that Names column. What I want to do is to return multiple value of Id Number that consist of a multiple names separated by 'comma' inside Names column without modifying that column. Expected result is shown in Image 2.
Image 2
The problems are :
I want to get the value from the ID Number column based on Names
column that contain a name inside
I want to automatically get multiple values just like displayed in
Image 1
If there're two ID Number value that is the same, it will be deleted or not be shown in the result.
I don't mind any kind of method you guys will purposed to me. I will appreciate any solutions you offered. Thank you very much.
You can use
=IFERROR(INDEX($A:$A,SMALL(IF(ISNUMBER(FIND(E$1,$B$2:$B$11))*(COUNTIF(E$1:E1,$A$2:$A$11)=0),ROW($B$2:$B$11)),1)),"")
entered as an array formula using CtrlShiftEnter
or
=IFERROR(INDEX($A:$A,AGGREGATE(15,6,ROW($B$2:$B$11)/(ISNUMBER(FIND(E$1,$B$2:$B$11))*(COUNTIF(E$1:E1,$A$2:$A$11)=0)),1)),"")
entered normally.
EDIT
#Ron Rosenfeld is absolutely correct that the formulas as they stand would match (for example) Jo as well as John, although the effect is mitigated somewhat by the fact that they are using case-sensitive find with a capital letter at the beginning of each name (so Ange wouldn't match Hanger).
The modified formulas would be
=IFERROR(INDEX($A:$A,SMALL(IF(ISNUMBER(FIND(","&E$1&",",","&$B$2:$B$11&","))*(COUNTIF(E$1:E1,$A$2:$A$11)=0),ROW($B$2:$B$11)),1)),"")
and
=IFERROR(INDEX($A:$A,AGGREGATE(15,6,ROW($B$2:$B$11)/(ISNUMBER(FIND(","&E$1&",",","&$B$2:$B$11&","))*(COUNTIF(E$1:E1,$A$2:$A$11)=0)),1)),"")
I have 3 columns in my table and need to extract the one that does not contain the word "None".
Example:
Please help me with VBA code in which I can just extract the value into column1.
Since your question is tagged as excel-formula as well I offer you a formula based solution:
=CONCATENATE(IF(A1="none","",A1),IF(B1="none","",B1),IF(C1="none","",C1))
It connects texts of all of the needed cells but ignores cells with "none" in them, pretty straight-forward.
How to use Vlookup if the data that we want to match (col_index_num) contains a formula?
I want to match the vendor name to get the addresses. But the addresses contain Proper formula because I changed the address from all UPPERCASE to Proper. I thought that might be the problem why I get #N/A result.
For vlookup , make sure the field that you are trying to look up and the source table in which you are looking up the field are in same format (Vendor name. vlooking up numbers with text format creates error most of the time)
Also, there might be possibility hat there is really no match of the values that you are looking up . (may contain space)