Consider a list of strings in columnm A. Each member takes the form a_delimiter_b. The list also has quasi-duplicate members b_delimiter_a.
How can I select all the relevent entries without the "duplicates?" This is how can I query for entries in the columnn, and for each a_delimiter_b exclude b_delimiter_a?
Attempt:
I am trying to tag the duplicates in another column.
=IF(<condition>,"Keep","Delete")
I need a good condition that I cannot think up. If I use VLOOKUP both the "orginal" and the "duplicate" are taggef. For example if the element is A1="a_delim_b"
<condition> = ISERROR(VLOOKUP(b_delim_a, <list_range>, FALSE))
I can get "b_delim_a" by
CONCAT(TRIM(MID(SUBSTITUTE(A1,"_delim_",REPT(" ",LEN(A1))),(2-1)*LEN(A1)+1,LEN(A1))) & "_delim_" & TRIM(MID(SUBSTITUTE(A1,"_delim_",REPT(" ",LEN(A1))),(1-1)*LEN(A1)+1,LEN(A1))))
This does not work because if "b_delim_a" exists, all entries in the list are tagged for deletion.
How can I tag to keep only exacly one instance and tag to delete the other occurances?
Try the following in B1 and drag down:
=IF(COUNTIF(A$1:A1,MID(A1,FIND("; ",A1)+2,LEN(A1))&"; "&LEFT(A1,FIND("; ",A1)-1)),"Delete","Keep")
Related
I'm trying to compare two columns ("Shows") from different tables and showing which one has the greater number ("Rating") associated with it in another table.
Ignore the operation column above as part of the solution that I'm trying to get, it's just to illustrate for you what I'm trying to compare.
Important note: If the names are duplicated. Compare the matching pair in their corresponding order. (1st with 1st, 2nd with 2nd, 3rd with 3rd etc..) illustrated in the table below:
Thanks
You can try the following in cell F3 for an array solution that spills the entire result at once:
=LET(sA, A3:A6, rA, B3:B6, sB, C3:C6, rB, D3:D6, CNTS, LAMBDA(x,
LET(seq, SEQUENCE(ROWS(x)), MAP(seq, LAMBDA(s,ROWS(FILTER(x,(x=INDEX(x,s))
*(seq<=s))))))), cntsA, CNTS(sA), cntsB, CNTS(sB), eval, MAP(sA, rA, cntsA,
LAMBDA(s,r,c,IF(r > FILTER(rB, (sB=s) * (cntsB=c)), "Table 1", "Table 2"))),
HSTACK(sA, eval))
Here is the output:
Explanation
The main idea is to count repeated show values. We use a user LAMBDA function CNTS, to avoid repetition of the same formula twice. Once we have the counts (cntsA, contsB), we use MAP to iterate over Table 1 elements with the counts and look for specific show and counts to compare with Table 2 columns. The FILTER function will return always a single value (based on sample data). Finally, we prepare the output as expected using HSTACK.
Try-
=IF(INDEX(FILTER($B$3:$B$6,$A$3:$A$6=G3),COUNTIFS($G$3:$G3,G3))>INDEX(FILTER($E$3:$E$6,$D$3:$D$6=G3),COUNTIFS($G$3:$G3,G3)),"Table-1","Table-2")
I have 7 criteria = TMO-1 through to TMO-7
I have two scenarios to search from.
i have either got a single excel with TMO-6, TMO-201, TMO-67,... etc (some have a lot of values)
or i have split the cell up so the values are all in individual cells such that [TMO-6][TMO-201][TMO-67] etc
I have tried two equations from each. for the first one (the preferred solution) i have tried:
=IF(IFERROR(SEARCH("TMO-1",AB8),0) > 0, "TMO-1",IF(IFERROR(SEARCH("TMO-2",AB8),0) > 0, "TMO-2", "false"))
the problem with that is it finds anything that starts with TMO-1, so will show true if TMO-12 is in the cell.
For option 2 i tried:
=IF(AB9:AR9=TMO-1, TMO-1, IF(AB9:AR9=TMO-2, TMO-2, IF(AB9:AR9=TMO-3, TMO-3,IF(AB9:AR9=TMO-4, TMO-4, IF(AB9:AR9=TMO-5, TMO-5, IF(AB9:AR9=TMO-6, TMO-6, IF(AB9:AR9=TMO-7, TMO-7, "N/A")))))))
and i get the error #spill
any ideas ?
Assuming:
ms365 (Hence the #SPILL error);
The option between concatenated values or seperated (hence AB8 against AB9:AR9);
All numbers are prepended with TMO-;
You are looking for the 1st match in sequence (1-7);
If no match is found, you want to return "Not Found".
First thing that came to mind is to just keep the comma-seperated data in AB8 and use a simple trick to concatenate the delimiters with the sequence:
=ISNUMBER(FIND("-"&SEQUENCE(7)&",",A1&","))
To put that in practice, try:
Formula in B1:
=IFERROR(MATCH("X",IF(ISNUMBER(FIND("-"&SEQUENCE(7)&",",A1&",")),"X"),0),"Not Found")
Other options:
=#IFERROR(SORT(FILTERXML("<t><s>"&SUBSTITUTE(A1,", ","</s><s>")&"</s></t>","//s[substring(.,5)<8]")),"Not Found")
Or, using the insider BETA-functions:
=LET(X,MIN(--DROP(TEXTSPLIT(A1,"-",", "),,1)),IF(X<8,"TMO-"&X,"Not Found"))
I had similar question (link below), but it just lets say "add-on" to my issue that I found on the way.
Find all code combinations using text string in Power Query
What I need is to extract exact matches (or I would say fuzzy matches in Power Query) that are in one string using substring as lookup.
(Please ignore T1 and T2 in the screenshot and data)
As you can see in Table 3 (T3) is a main string, and in T4 is substring with slightly different markings (like JH instead of JH0 or else..) Thats exactly what I need, to use substring as it is but to filter out main string and get results as they are in T5.
I tried my luck using Fuzzy matching in Power Query but the problem is afterwards when I have different substring with more instances, my query is failing due to "column doesn't exist and so on...it has to be dynamic.
I would like to have solution in Power Query!
https://docs.google.com/spreadsheets/d/1Ji1kyV7UsD2YBRJgWUY5zisyL3ySPGwW/edit?usp=sharing&ouid=101738555398870704584&rtpof=true&sd=true
let Source = Excel.CurrentWorkbook(){[Name="Table4"]}[Content],
FindList = Text.Split(Table.ReplaceValue(Table3,",","_",Replacer.ReplaceText,{"String"})[String]{0},"_"),
FindList2 = List.Transform(FindList, each Text.Remove(_,{"0".."9"})),
Newlist=Text.Split(Source[Substring]{0},"_"),
Newlist2=Text.Combine(List.Transform(Newlist, each try FindList{List.PositionOf(FindList2,_)} otherwise "missing"),"_")
in Newlist2
what it is doing (a) split table3 into a list at either a , or _ (b) duplicate the list from A and remove all numbers (c) split table4 into a list at each _ (d) match each value from c against b. If there is a match, use that position number to pull the value from a, otherwise put "missing" (e) put the results back together with a comma separation
Per comments, alternate version that works for multiple matches from Table3:
Newlist2=Text.Combine(List.Transform(Newlist, each try
if List.Count(List.PositionOf(FindList2,_,20))=0 then "missing" else
Text.Combine( List.Transform(List.PositionOf(FindList2,_,20), each FindList{_}),"_") otherwise "missing"),"_")
I've got the following table:
I'm using the following formula in column F to get the sum of the values in column E: =SUMIFS(E:E,C:C,LEFT(TRIM(RIGHT([#[Object Name]],LEN([#[Object Name]])-FIND("=",[#[Object Name]]))),4),A:A,INT([#[Result Time]])) but it doesn't seem to work.
Evaluating the formula gives me the following result:
Can someone please take a took at the for
You are looking for an object name of "T054", when they all appear to be "CELL=T054CID"... so no results are being returned.
What exactly is it you are trying to do?
Is there any reason you cannot just do:
=SUMIFS([3G_Traffic_CS],[Object Name],[#[Object Name]],[Result Time],[#[Result Time]])
You will also notice that I am referencing just the column cells within the table, rather than the entire column. This is more efficient and will prevent any extra values which appear under the table being counted (unlikely but not impossible).
ALTERNATIVE (Using a Helper Column)
Add a helper column which contains a trimmed value of the Object Name and compare to that:
=SUMIFS([3G_Traffic_CS],[Trimmed Object Name],[#[Trimmed Object Name]],[Result Time],[#[Result Time]])
ANOTHER ALTERNATIVE (Using FIND and SUMPRODUCT)
If you want to include any Object Name which CONTAINS your trimmed value, you can do this using the FINDfunction with SUMPRODUCT:
=SUMPRODUCT(
([Result Time]=[#[Result Time]])*
(ISNUMBER(
FIND(LEFT(TRIM(RIGHT([#[Object Name]],LEN([#[Object Name]])-FIND("=",[#[Object Name]]))),4),
[Object Name]
)
))*
[3G_Traffic_CS]
)
YET ANOTHER ALTERNATIVE (Using a Wildcard as per #Jvdv's comment)
Again, this assumes that you want to include all Object Names which CONTAIN your trimmed site ID. Simply add a "*" to the start and end of your trimmed Object Name.
=SUMIFS([3G_Traffic_CS],
[Object Name],
CONCAT("*",
LEFT(TRIM(RIGHT([#[Object Name]],LEN([#[Object Name]])-FIND("=",[#[Object Name]]))),4),
"*"
),
[Result Time],
INT([#[Result Time]])
)
So say I have a table x by y entries.
X is far too great, or changes often enough, that making X additional tables/lists/named ranges is absurd.
However, I need to make a drop-down list of some of y.
Specifically:
Name | A | B | C | ..
Yannis| 20 |Yellow| Green| ..
Mirrah| 400 |Purple|Yellow| ..
.
.
.
I need a drop-down select of Name to change the options in a different drop-down list, which is based off of B & C.
Normally you can do this with either a Filter or INDIRECT(). However, it is beyond unreasonable to create a unique table, or name define, for each entry in X.
It is possible to create a table with all the possible entries for B & C, if there was a way to filter a named define for a list based off of the first table (using vlookup(), most likely)
In layman's terms: I need list 1 to filter list 2 where list 1 is either enormous or subject to constant change.
Gah, so this:
=INDIRECT("'InfoDump'!" & ADDRESS(MATCH(C5,PkmList,0)+25,10))
put into the data validation list works, however it's only one entry, and I need 3.
simply adding commas and copies causes error messages.
The one entry that this supplies is correctly referenced (dynamically) from the table without any need for more tables/namedRanges.
C5 is where the first list is
PkmList is the NamedRange for the first column of the Table
+25 'cause the table starts at A25 (column title)
10 referencing the first of 3 columns I need in the second list.
Okay!
After some experimentation, this accomplishes what I was looking for:
=INDIRECT("'InfoDump'!" & (ADDRESS(MATCH(C5,PkmList,0)+25,10)) & ":" & ((ADDRESS(MATCH(C5,PkmList,0)+25,12))))
or, in some different terms:
=INDIRECT("'sheetName'!" & (ADDRESS(MATCH(DropDownOne,DropDownOneCriteria,0)+(AdjustRow),(AdjustColumn))) & ":" & ((ADDRESS(MATCH(DropDownOne,DropDownOneCriteria,0)+(AdjustRow),(AdjustColumn)))))
Data validation hates logic.
-
In the most basic sense:
Match(a,b,c) gets the location of 'a' in 'b' (c is the same as vlookup's exact match option)
Address(row,column) gets the "j26" address, you can (as I did) adjust from where you found the match. (in my case, 25 down 'casue the table actually started at A25, but the list started at '1'; then 10 - 12 across for the 3 options I needed to list)
indirect(txt) turns this into a list. more or less. use "'sheetName'!" for referencing a different sheet.
-
So in the end this gives you a "=A2:A4" in the Data validation bar, based on another list. Same as using the popular work around that is the fruit vegetable cabbage example, but this doesn't require you to make multiple named ranges. (Which means it works for a single large changing table).