Removing several desired rows from excel sheet using the second sheet - excel

How can I remove specific rows which has the same values in another excel sheet? of course there are many columns but I filter such that specific rows remained in the second sheet and we have those values in first sheet as well as other values. for example below I want to delete rows from second set with the same value in the first column of second set. rest does not matter
A B C
1 2 3
4 5 6
7 8 9
10 1 1
second set
A B C
1 5 6
3 3 9
7 7 6

This checks if the value in A2:A4 is in the other sheet in the A-column:
Formula used (I replaced the ´;´ with ´,´)
ISNUMBER(XLOOKUP(A2,Sheet2!$A:$A,Sheet2!$A:$A,"NOPE"))
The only thing left to do is filter by color and delete the rows. Though do remember that deleting rows in larger quantities, if they're not continuous, can be quite slow.

Related

How to create two columns that match all values from a third in excel or OpenOffice?

I have one column with 10 cells, every cell have a different value in it. How can I create two columns that have every cell matching with the other 9.
Example :
1
2
3
4
5
6
7
8
9
10
Become
1 2
1 3
1 4
1 5
......
2 1
2 3
2 4
2 5
.....
10 1
10 2
10 3
10 4
10 5
10 6
10 7
10 8
10 9
I am not sure I read the same question as others did. I think your example was merely that, an example, and that these first 10 cells could contain anything and you wanted every permutation that could result. While I think that the other answers might work for the specific situation you describe, they may not work if you had other data in those cells. Hence I am offering a variation which uses a similar technique to reference the cells indirectly. The permutations of 2 objects from a set of 10 unique objects would result in 90 objects (which is why the above technique from Tom Sharpe references 90).
Assuming that you have your 10 items in A1 through A10, I would put the following formula in B1 and copy it down through B90:
=INDIRECT("R"&QUOTIENT(ROW()-1,9)+1&"C1",FALSE)
Also, I would use this formula in C1 and copy it down through C90:
=INDIRECT("R"&MOD(ROW()-1,9)+1+((MOD(ROW()-1,9)+1)>=QUOTIENT(ROW()-1,9)+1)&"C1",FALSE)
The result should give you something like what is shown in the attached matching your example.
Likewise, it would show the permutations of any values you had in A1 through A10 as shown in the second attached picture with words instead of the numbers 1 through 10.
In Excel (without VBA or such like), one way:
In A1 and copied down to A100: =INT((ROW()+9)/10).
In B1 and copied down with Ctr to B10: 1.
Select B1:B10 and copy down with Ctrl to B100.
In C1 and copied down to C100: =A1=B1.
Select ColumnsA:B, Copy, Paste Special, Values.
Filter A:C ,select TRUE in ColumnC and delete all blue indexed (visible content) rows.
Delete ColumnC.
Or in A1:
=QUOTIENT(ROW()-1,9)+1
copied down to A90 just to be different.
Then in B1:
=MOD(ROW()-1,9)+1+((MOD(ROW()-1,9)+1)>=A1)
copied down to B90.

Dynamically change row number in excel

I got a file in excel that often changes the row number (My first column) whenever there is a insertion of data. However, there is multiple rows of data with the same row number.
Example:
1
1
2
3
3
3
Is there a way I can change them dynamically beside grouping the number together via Filter and change it manually?
Edited.
1
1
1
2
3
4
4
4
Better example. Sorry about the indentation.
I can propose a partial solution.
Set the value only in the first identical value and change only those unique values when a group of rows is inserted:
1 1
1 =A1
1 =A2
2 2
3 3
4 4
4 =A6
4 =A7
Otherwise, you do it from VBA to change all values when a new row is inserted.

Sum across columns based on 3 criteria

I'm trying to get a Sumif working across multiple rows.
For example, say my data source is below:
A B C
1 1 10 11
2 2 9 12
3 3 8 13
4 4 7 14
5 5 6 58
I want to sum from Columns A to C, in row 3. Output would be 24.
Ideally my criteria for the Horizontal Start, Horizontal End and Vertical would all be referenced in different cells which can be updated to get a new result depending on the criteria.
Is this possible so that the criteria cells can be updated and the formula will update accordingly?
Use a SUMIF, and betweem the logical criteria, simply use 3 criterias by seperating each with "&"'. This says that excel will sum if a happens, and b and c.

Find maximum of row, return column name

I have four rows and six columns of random numbers between 1 and 10. The headers atop are named A through F accordingly. I want to populate a range (A1:A6) on another sheet with the maximum number for each row. That is easy with the MAX function. However, in a another range (B1:B6), I want to put the column name to which this number belongs.
An HLOOKUP() won't work because a maximum value in one row is likely not unique number across the entire sheet. I am thinking a MATCH INDEX type function, but my understanding of those functions, especially in conjunction, is poor.
A B C D E F
1 0 2 10 9 8
9 3 7 6 9 10
10 3 0 2 1 4
9 4 7 8 6 3
Assuming your array is in Sheet1 and the columns are labelled, please try in another sheet, copied down to suit (to Row4 since there are only four rows of numbers in your data):
=INDEX(Sheet1!A$1:F$1,MATCH(MAX(Sheet1!A2:F2),Sheet1!A2:F2,0))
This will return only the first column label from a row where the maximum for that row occurs more than once.

Sum only visibile cells using SUBTOTAL in Excel

I'm intending to get the current balance of a stock using an Excel sheet. In this workbook, the balance is entered every day. However only the most recent day's balance is actually shown, all other are hidden. The data is entered in columns, and hence only one column of data is shown.
In this example, I want to sum the values from row 21 to 24. I enter the formula from the first documented balance, to some columns ahead in time (so the range does not need to be changed often).
For this I use:
=SUBTOTAL(109,C21:O24)
The last column's values sums to 20. However, using this formula sums to 260. It actually sums all values in row 21 to 24!
I confered the site https://support.office.com/en-us/article/SUBTOTAL-function-7b027003-f060-4ade-9040-e478765b9939 where it says that the value "109" should be used as the first argument in order to only sum non-hidden values. But evidently, this does not work. I also tried to use "9" as the first argument as well with the same result.
What is it that I am missing? Why doesn't this formula execute as intended?
MCVE (I reckon that if this is copied into cell A20, the value should become 260. When hiding all columns but A,B and O should give 20 using SUBTOTAL, but for me it still produces 260).
Stock
Prod1 5 5 5 5 5 5 5 5 5 5 5 5 5
Prod2 5 5 5 5 5 5 5 5 5 5 5 5 5
Prod3 5 5 5 5 5 5 5 5 5 5 5 5 5
Prod4 5 5 5 5 5 5 5 5 5 5 5 5 5 =SUBTOTAL(109;C21:O24)
Regards
From the documentation:
For the function_num constants from 1 to 11, the SUBTOTAL function includes the values of rows hidden by the Hide Rows command under the Hide & Unhide submenu of the Format command in the Cells group on the Home tab in the Excel desktop application. Use these constants when you want to subtotal hidden and nonhidden numbers in a list. For the function_Num constants from 101 to 111, the SUBTOTAL function ignores values of rows hidden by the Hide Rows command. Use these constants when you want to subtotal only nonhidden numbers in a list.
So that can't be used to sum cells hidden by columns.

Resources