Dynamically change row number in excel - 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.

Related

Removing several desired rows from excel sheet using the second sheet

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.

How to average each value in two separate sheets in excel into a third sheet

Say I have an excel file with two sheets:
Sheet 1
2 2 2
4 4 4
Sheet 2
0 0 0
2 2 2
How would I take the average of each individual value from sheets 1 and 2 respecting their positions to produce a third sheet with averaged values like so?
Sheet 3
1 1 1
3 3 3
I am trying to follow this tutorial but that only produces one value in one cell for me. It appears to be taking the average of every number across two sheets and giving back one number)
Use AVERAGE with a 3d reference:
=AVERAGE(Sheet1:Sheet2!A1)
Note that Sheet1 and Sheet2 need to be next to each other and in that order.
If the sheets are not next to each other then:
=AVERAGE(Sheet1!A1,Sheet2!A1)

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.

Way to count last values before each zero?

I am trying to count the last value before it resets back to zero multiple times per column. Here is my example
1
2
3
4
5
6
7
8
0
1
2
3
4
5
6
0
1
0
0
1
2
3
0
And the list goes on but for this example I would be looking to do something like a LARGE or SMALL where I could get the answers like this:
8
6
1
3
Ultimately I would like them to be in the descending order, but if that isn't part of the formula I can take care of that if I can just figure out a way to capture them.
Can this be done?
You can try the following in column B try the following =IF(A2=0,IF(A1=0,"";A1),"")
then filter column B on non blank value
Put your original data in column B
In cell A2 enter:
=IF(AND(B2<>0, B3=0),MAX($A$1:A1)+1,"")
and copy down. Finally in C1 enter:
=VLOOKUP(ROW(),$A$1:$B$23,2,FALSE)
and copy down till you see errors. Should look like:
Basically column A is a "helper" column used to mark all the "good" values to facilitate easy pick-up

Highlight duplicate cell values in different colours

I'm using conditional formatting to highlight duplicate cells, but I have up to 5 instances of a duplicated value. How can I apply a separate colour to each duplicated cell?
So if I have 5 instances of ABC123, how can the first instance be red, the second green, the third blue, fourth yellow, fifth orange (or whatever colours)?
I take it this is in Excel 2007? In earlier versions you can only have three different conditions.
The way I'd do this is to introduce a 'helper' column, containing a formula which provides the count of duplicates up to that row number:
Say you have your list (including dupes) in range A1:A10, and in column B1:B10, a formula of the form =COUNTIF($A$1:A1,A1) through =COUNTIF($A$1:A10,A10), you'd have
A B
------------
1 4 1
2 2 1
3 4 2
4 3 1
5 1 1
6 2 2
7 4 3
8 2 3
9 2 4
10 1 2
I don't know your exact Conditional Formatting requirements, but you can now use 5 nested IF formulas to take account of not only the fact that something is a dupe (cell in B is >= 2), but also the count of the dupe.

Resources