I looked around for a bit and didn't see any question quite like the one I have. I have a sheet with over 80k values in column A. What I need, is to remove every occurrence of a duplicate. If the value 5 appears more than once, I don't want the value at all. For example, if I have something like this:
A
1
2
2
3
4
3
I ONLY want the values of 1 and 4, because they only appear once. I'd like every other value deleted, or to have only the values like 1 and 4 appear in another column.
Any help is greatly appreciated.
Work on a copy as the following deletes records from source data. In B1 (adjust 90000 to suit):
=COUNTIF(A$1:A$90000;A1)>1
and copy down to suit. Filter A:B, select 1 for ColumnB and delete the selected rows. Change filter to select All.
Related
I want to know how to use a FOR loop for a specific column in a table.
Basically. I want to get the text in the third column and equate / verify it to be "LOCAL" for all rows. I will provide a basic diagram of the table
So, in the diagram the checkboxes take up as first table cell and the top row is a table header.
What i want is to get the text of all the cells under column /th4 and equate it to be as "LOCAL" as said before. There might be multiple entries and will be dynamic. So, that is why i want to use FOR loop.
PS: every cell under /th4 is LOCAL , so just want to equate the text.
My code:
Click Element xpath=//*[#id="selectType"]/div/div[2]/ul[2]/li/div
Sleep 0.1
Click Element class=dropdown-btn
Sleep 0.1
Click Button id=filterBtn
Sleep 0.1
Click Element id=closeFilter
Table Row Should Contain xpath=//*[#id="myTable"]/tbody/tr[1]/td[4]/span 1 LOCAL
Table Row Should Contain xpath=//*[#id="myTable"]/tbody/tr[2]/td[4]/span 2 LOCAL
Table Row Should Contain xpath=//*[#id="myTable"]/tbody/tr[3]/td[4]/span 3 LOCAL
Basically, there is filter option... once i filter, the fourth /td in the table will all contain text "LOCAL".
Instead of me manually typing "table row should contain" keyword, i want to for loop it to verify all the cells in that column
Let me know if any other information is required.
Thanks and Regards,
Sandesh K S
For loop is not the best option here because you usually need to know beforehand how many elements you have and you mention that number of rows can change. It would be better to use while loop:
${row}= Set Variable 1
WHILE True
${elements}= xpath=//*[#id="myTable"]/tbody/tr[${row}]/td[4]/span
${num_elements}= Get Length ${elements}
IF '${elements}' == '0'
BREAK
END
Table Row Should Contain xpath=//*[#id="myTable"]/tbody/tr[${row}]/td[4]/span 1 LOCAL
${row}= Evaluate ${row} + 1
END
I'm trying to use Vlookup in a Google Sheet using an ID to match 2 separate tables. If there is no match in the first table, then I am telling the code to search for it in the second table. The lookup value, and 2 tables are all in different sheets and it doesnt work but I am able to get another test to work when they are all on the same sheet so I am not sure why that is.
For example this works
arrayformula(IFERROR(if(vlookup(A2:A,D2:E,2,FALSE)<>"",vlookup(A2:A,D2:E,2,FALSE),vlookup(A2:A,G2:H,2,FALSE))))
ID
Vlookup
ID
Vlookup value
ID
Vlookup value
1
One
1
One
1
2
Two
2
2
Two
3
Three
3
Three
3
4
Four
4
4
Four
5
This Full Formula fails
Arrayformula(IFERROR(IF(vlookup($B$2:$B,Sheet1!$A$3:$I,4,FALSE)<>"",vlookup($B$2:$B,Sheet1!$A$3:$I,4,FALSE),vlookup($B$2:$B,'Sheet2'!$A$1:$N,4,FALSE))))
I'm not sure how to moidfy my formula, which works in individual parts and together it matches data in Sheet1! but not on Sheet 2! based on my tests.
Testing Results
Arrayformula(IFERROR(IF(vlookup($B$2:$B,Sheet1!$A$3:$I,4,FALSE) --> Vlookkup matches Sheet1! data also
Arrayformula(vlookup($B$2:$B,'Sheet2'!$A$1:$N,4,FALSE) -->matches Sheet2! data
Modify the second part of the data to "False"
Arrayformula(IFERROR(IF(vlookup($B$2:$B,Sheet1!$A$3:$I,4,FALSE)<>"",vlookup($B$2:$B,Sheet1!$A$3:$I,4,FALSE),"False"))))
Result: Anything that does not match in either Sheet 1 or Sheet 2 says "False". But a match in Sheet 1 works and a match in Sheet 2 shows blank.
Modifying the IF statements to make consistent did not work either
Arrayformula(IFERROR(IF(vlookup($B$2:$B,Sheet1!$A$3:$I,4,FALSE)<>"",vlookup($B$2:$B,Sheet1!$A$3:$I,4,FALSE),
IF(vlookup($B$2:$B,Sheet2!$A$1:$N,4,FALSE)<>"",vlookup($B$2:$B,Sheet2!$A$1:$N,4,FALSE),""))))
How can I modify the formula so that it works in unison?
This works
=arrayformula(IFERROR(if(vlookup(A2:A,Sheet1!A1:B5,2,FALSE)<>"",vlookup(A2:A,Sheet1!A1:B5,2,FALSE),vlookup(A2:A,Sheet2!A1:B5,2,FALSE))))
Still unsure if there is another error in the formula above that didn't work as I think it should have worked
Good day,
I have seen from here a solution to control duplicate entries into a single column. A Data validation with this custom formula works well for one column.
I would like to achieve the same effect over multiple columns ... i.e. unique row entries across multiple columns. Take for example below three columns A-C. Only when values {1,2,1} are entered for the second time will the input be rejected.
A B C
1 1 1
1 2 1
1 2 2
2 2 2
1 2 1 X Entry should be rejected.
Is there a quick way to do this using Data Validation - custom formulae?
use custom formula for data validation:
=INDEX(COUNTIF($A$1:$A&"×"&$B$1:$B&"×"&$C$1:$C, $A1&"×"&$B1&"×"&$C1)<2)
I have a simple data set something like this one.
data = [ {column:'a',value:10},
{column:'a',value:2},
{column:'a',value:5},
{column:'b',value:12},
{column:'b',value:1},
{column:'b',value:8},
{column:'c',value:6}]
I have created a group on top of this data and used in data table which shows something like this
(* considering all the dimension and groups are created at this stage)
Column Value
A 17
B 21
C 6
The real problem comes when I try to filter the data, I have attached a text filter to this. Whenever I try to filter it the records which have value == 0 doesn't not disappear rather it stays showing the value as 0 something like this
Case 1 : The textfilter is filtered with column 'a' the table is showing like this.
Column Value
A 17
B 0
C 0
How do I make the ones with zero value disappear from the table on filter while using groups in the data table ?
I am assuming you are looking for something like the chart build in following link:
dc charts with filtering removing
You can see the source code, they have written a method called "remove_empty_bins". You can also implement something like that.
I hope this answer your question. If you need more help, please create a demo for your problem.
I am looking to find the mode (most occurrent) value of one column, given another column.
I know how to do it but the calculation takes multiple minutes and can make Excel unresponsive. Therefore I am looking for a better way.
Suppose my data looks like this
group | Level
1 D
1 A
1.1 B
1 C
1 A
1 E
Then I want the output to look like this:
group | LevelMode
1 A
1.1 B
Assuming the data is in the upper left corner of the worksheet, I am now using this formula, which I drag along the C column:
=COUNTIFS(A:A;A2;B:B;B2)/COUNTIF(A:A;A2)
This gives me the ratio of values within the group. Afterwards I remove all that are not above 0.5 as well as duplicates, giving me the mode for each group if it exists.
This formula does exactly what I want, but for about 50000 lines it simply takes too many resources. I expected to find this in the pivot table options, or after a quick search online, but I have not found any way to achieve my goal.
I have decent hardware, a fairly recent version of Excel and would prefer to do this without macro's. However, if macros are required to achieve this then so be it.
Try this:
Step 1.
Create the Pivot Table and place in RowLabels "Group" and under it "Level". Now, place "Level" as count in "Values" field.
Step 2.
See the picture below. Click in the black arrow in the right side of "Level" (you can't see it in the picture but it is supposed to be inside the red circle).
Choose "Values Filters", then "Top 10" and then set the number to 1 (top 1). Done!!
Attention: you need to do step 2 for "Level". If you do the same to "Group" it will not work.
Edit: this is the result and how the Pivot Table should look like.
Now to shape the output to the desired format:
Under PivotTable tools > Design, set the Report Layout to Tabular form
Disable totals and subtotals
Assuming default settings you can now easily copy the list of Groups and LevelModes