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
Related
In my list in Excel I have in Column A following data:
Cell A1 = GG-10000
Cell A2 = GG-10000
Cell A3 = GG-10005
Cell A5 = GG-10047
cell A6 = GG-10047
Cell A7 = GG-10047
Cell A8 = GG-10050
Cell A9 = GG-10050
Cell A10 = GG-10100
and so one...
Can someone tell me how to bold the lines as below
cell A1 = GG-10000 (this need to be in bold)
Cell A2 = GG-10000 (this need to be in bold)
Cell A3 = GG-10005
Cell A5 = GG-10047(this need to be in bold)
Cell A6 = GG-10047(this need to be in bold)
Cell A7 = GG-10047(this need to be in bold)
Cell A8 = GG-10050
Cell A9 = GG-10050
Cell A10 = GG-10100(this need to be in bold)
So the idea is that I can see the difference between the different numbers.
Many thanks
Robin
You can use conditional formatting.
If you have Office 365 Excel you can use this formula:
=ISODD(MATCH(A1,UNIQUE(FILTER(A:A,A:A<>"")),0))
UNIQUE => a list of the unique entries
MATCH => position of each individual entry in the unique list
ISODD => returns alternating boolean when the entry changes
If you don't have these Excel O365 functions, I'd suggest you develop a VBA routine or use a helper column to do something similar.
Here's an example of a "helper column"
I'll use column B, but you can use any column anywhere; and you can hide it.
B1: 1
B2: =IF(A2=A1,B1,-B1) and fill down
Conditional Format formula:
=B1=1
Since the CF Applies to range is unchanged, that will still be the range that gets formatted.
If you are okay with a helper column then in cell B1 put 1.
and in cell B2:
=IF(A2=A1,B1,B1+1)
which you shall copy down. Afterwards, for A1:A9 range apply conditional formatting like below:
The outcome if implemented correctly will look like below.
I need to insert a value to a cell in excel using formula in another cell.
Say
A1 = "Test"
B1 = formula to insert A1 to C1
C1 = A1
Can I write a formula in B1 to insert value in C1?
I don't need any formulas in C1.
If Yes, What should be the formula?
If there it is next to the cell AND has no value in B2, it is possible, otherwise it is not.
Use Split()
Split(CONCATENATE("Text for B1#Sperator$$",A1),"#Sperator$$",FALSE)
It really depends.
EDIT
Out dated. Only works in google sheets.
Without using VBA or formulas in column C you can't achieve this.
A simple solution using formulas:
In cell C1, paste the following formula and drag it down:
=IF(B1=1;A1;"")
So if the content of cell B1 is equal to 1, your cell at column C will display the respective value of the same row at column A.
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
I have a simple formula =sum(sum(d5*u300)/g4)
Is it possible to have the formula look up cell A1 for the d, a2 for the 5, a3 for the u, A4 for the 300, A5 for the the g and a6 for the 4. In other word each formula cell reference is made up of the contents of two other cells.This would be used in a selection process to produce a table for a graph. NON Excel Users could then use a drop down list in A1 to select column d etc. With thanks.
Do you mean something like:
=SUM(SUM(INDIRECT(A1&A2)*INDIRECT(A3&A4))/INDIRECT(A5&A6))
? Let's say A1 contains D and A2 contains 5. Then INDIRECT(A1&A2) will return the value of the cell D5.
However, I don't understand why you use SUM with just one argument.
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