Let's say I need to select a range in Excel from A2 to A1,(if I'm inserting something, it needs to insert to a2 first).
No matter which direction I choose, Excel automatically chooses Sheet1!$A$1:$A$2. I tried to even manually change it to Sheet1!$A$2:$A$1 but that didn't work.
How can I either disable this automatic selection or how to choose a range from bottom to top?
The real alternative would seem to be not to insert into A2 before inserting into A1 but to insert into A2 first and then keep inserting into A2, with Shift cells down.
From bottom to top you have to select range from bottom, like I did in my countif formula:
=COUNTIF($AA$8:AA8,AA8)
I locked AA8 cell and made it range with same cell because there were no other rows above the current row. And criteria was again this cell so I got my result.
Related
For example I created conditional formatting using formula with red, but after I finishing this I copy all the way to the right, selecting cells to apply to ; It worked when I dragged them to the right But it does not work when I drag down.
Here is my formula
Here is my table
So I did this manually I also tried CONTROL+C and PASTE formats
The problem is I changed references on top I do not know starting reference what should be and every time I wanna apply to both rows and columns what formula should I write?
If you have equal spaces between low and high blocks of data, you can use offset inside condition
Select columns E:J
New Rule > Use formula
Type formula: =E1>OFFSET(E1,-7,0) (7 is a distance between each lower and higher cell to check
Set desired color and press ok
Since formula relative so will update for each cell
Your conditional formula has absolute references to the row: E$13 > E$6
But the "Applies to" describes cells all in a single row. So locking the formula to refer to a specific row makes no difference. (If anyone can word a clearer explanation please submit an edit!)
If you change the formulas to E13 > E6 you should be able to copy the formatting across and down your sheet.
Make the formula correct for the first cell in "Applies to", and Excel will apply it to the rest of the range as if you'd copied and pasted it.
So you could probably set a single rule: E11 > E4, and apply it to all the blocks: E11:F13;I11:J13;E17:F19;I17:J19;...
Is there a way to self-reference the cell inside an expression?
For example:
if I want A2 cell to have +1 value in respect of the cell above I write:
=A1+1
If I cut and paste this expression in another cell, it still references to A1.
How to replace that =A1+1 with something like:
=cell.value(this.X,(this.Y-1))+1
UPDATE
Just another use case: create a numbered list (yes, I know excel lines are already numbered, but what about printing?).
Until now I put 1 in A1, =A1+1 in A2 and then dragged A2 lower right corner down to the desired line.
In this way if I delete a row, the following ones become of undefined value.
By putting =OFFSET(A2;-1;0)+1 in A2 and dragging, I can then delete intermediate lines without breaking the sequence.
I guess there are zillions of better/smarter/faster ways of doing this.
use Offset()
so the cell formula would be:
=OFFSET(A1;-1;0)+1
If you copy&paste the actual contents while editing the cell, paste will then put the exact same text into any other cell you select. If you make sure you are not editing the cell, highlight it, copy and then paste into another cell, Excel will automatically update the column and row.
Highlight the cell when not in edit mode, paste into the one below, it will automatically update the row number, =A1+1 will become =A2+1. If you paste it into the cell to the right, it will update the column letter, =A1+1 will become B1+1.
So, for example, if you have the number 9 in cell A1, then enter =A1+1 in cell A2 it will show a value of 10, if you then copy cell A2 (the cell, not the contents) to cell A3, that cell will display the value 11, and contain =A2+1.
If you want to do a long range of cells that add 1 to the previous cell, taking the previous example, highlight cells A2 and A3 then click and hold on the little square at the bottom right of the selection, and drag it as far down column A as you want.
So basically I am trying to create a pattern in excel by subtracting each of the elements in Column D from just Cell A2. I need the pattern to always subtract the value of the variable column D cell just from cell A2. So I started off setting D2 (after the heading) to (D2-A2). Then I set D3 to (D3-A2). Then I set D4 to (D4-A2). I then highlight these three cells, hoping the pattern was apparent. I click and drag the bottom right corner of the last cell downward, but excel proceeds to give me (D5-A3) for D5, (D6-A4) for D6, (D7-A5) for D7, etc....
Does anyone know how to fix this issue? I want to be able to create this pattern for the column, but it's not able to pick up on it when I drag the lower-right corner of the highlighted cells downwards.
In the first cell, use =(D2-A$2). The "$" makes it so that Excel does not change this component when copy-pasted.
Is it possible to reference a cell outside the "Applies to" area in a conditional formatting formula?
I have a small table in which I would like any blank cells to be highlighted only if the first cell of the respective table row is not blank. The first cell should never be highlighted.
I would rather not use Visual Basic, if I don't have to.
Thanks
Yes, you sure can. You can use the formula:
=AND(NOT(ISBLANK(A$1)),ISBLANK(A2))
Where the first row is in 1:1, A2 is the active cell.
I have a spreadsheet that is extremely long and I would like to create a new column (actually, 8) where each cell in the new column is the sum of two cells in other columns. An obvious answer is to create the column, create an instance of the formula in the first cell, and drag the formula down. However, since the spreadsheet is so long and I would like to do this 8 times, that process does not make sense for me. Is there an automated way to do this? I have never worked with VBA but have enough programming experience that I figure I could figure it out. Thank you.
What I do, E.g. long data in columns A & B
Put formula in C1 & D1
Click in B1, Ctrl+down-arrow to go to the last cell, go over to C & D & type in any value
Click C1, Shift+ctrl+down-arrow to select the empty cells, same with left-arrow to select horizontally
ctrl+D to fill with the formula
highlight the cell(s). double click on the black box in the corner, and the formula gets filled down to the end of the data next to it.
In pictures:
hover here:
Your cursor should change to a black + when you are hovering over the dot.
After you double click, the formula will be filled down
this way will copy the formatting of that cell, but if you don't want that, you can click on the menu popup (lower left of filled area)
and select fill without formatting