I have an excel file. B1 has the text value ME. B2 has a number value 01.
From C1 to C100 the values are shot001 to shot100.
I would like to do a formula in G1 that concatenates: B1+B2+C1 then in G2 I needB1+B2+C2 then in G3 I need B1+B2+C3.
I've done a formula in G1 = CONCATENATE(B1,B2,"_",C1). If I drag the formula along the G column the value B1 and B2 change in B3 and B4, then in B5 and B6.
My problem is that I don't know how to force the formula to use ALWAYS in each formula B1 and B2.
Use dollar $ sign to fix cell coordinates. $B1 will fix column B if you drag horizontally. B$1 will fix row 1 if you drag vertically. $B$1 will fix both row and column wherever you drag:
=CONCATENATE($B$1,$B$2,"_",C1)
When you use the formula in G1 of:
=CONCATENATE(B1,B2,"_",C1) -> [B1][B2]_[C1]-> -> ME01_Shot001
then if you fill down each row will update the respective cell reference, so for example G2 will fill to:
=CONCATENATE(B2,B3,"_",C2) -> [B2][B3]_[C2]-> 01_Shot002
To keep the formula always referring to cells B1 and B2, you need to lock them down using a $ in the code. This will keep the absolute value of the cell rather than the relative value. So, the formula for G1 should instead be:
=CONCATENATE(B$1,B$2,"_",C1) -> [B1][B2]_[C1]-> ME01_Shot001
Then when you drag down, the formula in G2 will become:
=CONCATENATE(B$1,B$2,"_",C2) -> [B1][B2]_[C2]-> -> ME01_Shot002
You can read more about the use of $ and absolute vs. relative HERE
Also, for future reference the below code would also work:
=B$1&B$2&"_"&C1 -> [B1][B2]_[C1]-> ME01_Shot001
Related
Suppose, in Cell A1 of Sheet2 I use this formula.
=AVERAGE(Sheet1!A1:A10)
Now when I drag down from A1 to A3
A2 will be =AVERAGE(Sheet1!A2:A11)
A3 will be =AVERAGE(Sheet1!A3:A12)
However I want it in a transpose way. Such as,
A2 will be =AVERAGE(Sheet1!B1:B10)
A3 will be =AVERAGE(Sheet1!C1:C10)
Means, I will use drag down rather than dragging to side, yet I'll get the answer in transpose way, more specifically, I want to change column index rather than changing row index by dragging a formula down.
Is there any way to do that?
Thanks in advance.
One way is to use this formula in Sheet2 A1 and copy down
=AVERAGE(OFFSET(Sheet1!$A$1,,ROW()-1,10))
As you drag it down, ROW()-1 increases by 1 and this is the column offset from A1.
In A1, ROW()-1 returns 0 so there is no offset, but as you go down this increases by 1 and this is the column offset from A1 - so in row 2 this becomes B1 etc.
The 10 indicates the size of the relevant range to be averaged.
In A1 enter:
=AVERAGE(INDEX(Sheet1!$A$1:$Z$10,1,ROW()):INDEX(Sheet1!$A$1:$Z$10,10,ROW()))
and copy downward.
If you need more than 26 items, increase the Z in the formula.
I have a number in cell B2 and I want to make a sub this number with each number in the column C.
The results will be presented in a row (and I want to use the cross in the right corner of the cell to autofill).
Let me explain you what I want to show in each cell:
E2: $B$2-C5
F2: $B$2-C6
G2: $B$2-C7
In order not to write it manually in each cell, how can I change it (autocomplete C5, C6, C7) with the usage of the cross?
I tried to use the dollar like $B$2-$C5 and then drag the cross but it fills all the cells with the C5 value and not C6, C7 etc
In E2 enter:
=$B$2-INDEX($C:$C,COLUMNS($A:E))
and copy across:
For example I have cells A1,B1,C1. A1 and B1 are empty and C has a formula = A1+B1. I would like to do is that C1 will add A1 + B1 once B1 is no longer empty.
In reality, there would be D1,E1,F1 ... so forth with formulas as well. I can put the formulas inside a Workbook_change routine, but it would be very buggy if you do a copy and paste. I was wondering if there is another way of doing it?
You don't need VBA. In C1 you can enter this formula:
=IF(AND(LEN(A1)>0,LEN(B1)>0),A1+B1,"")
I need to write a formula in excel for dynamic subtraction which subtracts a cell(of a specified column) from the cell just above it.
For example, A2 = A1 - G1 (G column is fixed)
and A3 = A2 - G2
and A4 = A3 - G3
and so on.
Excel is smart enough to use a dynamic reference and relative reference to the current cell. For example if you put =A1-G1 in cell A2 and use the square to drag this cell down, you will automatically get the similar formula in all others in column A.
Video example: Copy cells and keep formulas relative to current cell
Hi I have three columns in MS Excell. The columns are A1,B1,C1. C1 is calculated automatically based on formula. The formula defined for C1 is(=A1+B1). I mean C1 is the sum of A1 and B1. Now the problem is I wanted to copy the value of C1 to A1 and want to make the B1 column filled with 0.
The moment i try to copy C1 and paste it into A1 the A1 is displaying as "#href" something like this. so how do i copy the value of C1(without Formula) and then paste it to A1?
When you copy from C1 in A1 Excel is trying to insert in A1 the same formula contained in C1 with your relative addresses adapted to the new position, so the new formula in A1 should sum the two cells at the left of A1, but there are not cells at the left of A1, so the #href error is telling you that.
To do what you want you should paste it like "value". You find that option in the Paste command