I am working on two worksheets to calculate the profit of the products. So what I have to do it take the cell from the main sheet (D3) and take another value and add it to the D3. The following is the formula I got(=D3+'Profits '!B3+'Profits '!B4+'Profits '!B5+'Profits '!B6). the problem is when I scroll down to calculate D4, D5, D6 the cell from the Profits sheet also increases. I only want the main sheet to increment and remain the same for the other sheet
example
=D3+'Profits '!B3+'Profits '!B4+'Profits '!B5+'Profits '!B6
=D4+'Profits '!B3+'Profits '!B4+'Profits '!B5+'Profits '!B6
=D5+'Profits '!B3+'Profits '!B4+'Profits '!B5+'Profits '!B6
How can I do that to achieve this formula in excel.
Thank you in advance.
Precede a row or column address with a $ sign to make it absolute, like $B$6.
An absolute reference will not change when copied to another cell. Rows and columns can be made absolute independently. $B6 will not change when copied left and right but will change when copied vertically. B$6 won't change when copied up or down but will adjust when copied left or right.
$B$6 will be unchanged during any copying.
Related
My question is related to a question asked earlier, but as I am a new member I was not able to comment on that question.
The earlier question asked how we can dedupe a list in a workbook to create a new list of unique values on another sheet in the same workbook. The top voted solution given by #achaudhr works for me but in that I need to specify the exact cells the formula needs to reference. In the comments on that answer #Dan has mentioned that we must use OFFSET if we are referring to a dynamic range.
This is the formula I am using at the moment:
B2=INDEX($A$2:$A$20, MATCH(0, COUNTIF($B$1:B1, $A$2:$A$20), 0))
I have tried using offset with this formula but I guess I am doing something wrong because it keeps giving me #N/A as a result.
If my data was in column A (as per the above formula), I want to be able to change the ":$A$20" part of the range dynamically. The list in column A changes as per an input I put in the workbook on another sheet (let's call it Sheet 3). Hence I cannot hardcode the cells in the index formula range or else I have to change this range every time my list updates.
Based on the above layout, the cell in E2 calculates the max cell number for the list in column A on sheet 1. This number changes when the input in Sheet 3 changes.
I edited the above formula to use OFFSET to reference E2 in the following way:
B2=INDEX(OFFSET('Sheet 1'!$A$1,'Sheet 1'!$E$2,0), MATCH(0, COUNTIF($B$1:B1, OFFSET('Sheet 1'!$A$1,'Sheet 1'!$E$2,0)), 0))
This formula is returning #N/A (and I did press Ctrl + Shift + Enter so its not because of that).
I hope the group here can help me solve this. Look forward to the inputs and thanks for all your help.
Thanks,
Neha
The way to use OFFSET in a dynamic range determining formula, where it is column length that varies, is to use that value as the [height] parameter.
So, in the case of your example, the formula would look like:
B2: =IFERROR(INDEX(OFFSET($A$1,1,0,$E$2-1), MATCH(0, COUNTIF($B$1:B1, OFFSET($A$1,1,0,$E$2-1)), 0)),"")
Reference: $A$1 (could also set this at $A$2 with a 0 Row offset
Row Offset: 1 (since A1 contains the header)
Column Offset: 0
[height]: Contents of $E$2 minus 1 (since we are not including the header in the list)
[width]: left blank
I have a formula for calculating a sum based on dates.
=SUMIF('Daily Expense'!A:A,CONCATENATE("2/",B1,"/2017"),'Daily Expense'!B:B)
Now I want all the columns of a row to have the same formula with only 1 change like
=SUMIF('Daily Expense'!A:A,CONCATENATE("2/",C1,"/2017"),'Daily Expense'!B:B)
For the next column and D1 for the next one and so on.
When I use the auto fill method of dragging the mouse from the bottom right it fills the function and changes it to
=SUMIF('Daily Expense'!B:B,CONCATENATE("2/",C1,"/2017"),'Daily Expense'!C:C)
All I want to change is the cell value in the concatenate function not the others.
Any idea how to do this?
A:A is a relative reference which will update as you move the formula. You just need to change it to absolute, like $A:$A:
=SUMIF('Daily Expense'!$A:$A,CONCATENATE("2/",B1,"/2017"),'Daily Expense'!$B:$B)
Now when you autofill it will only update the B1 reference.
In my excel sheet I need to expand my vertical range by one row. For instance, I need my C column to look like this (after 14th row):
C14--to be--> =NPV(B1, B9, B14:B14)
C15--to be--> =NPV(B1, B9, B14:B15)
C16--to be--> =NPV(B1, B9, B14:B16)
and so on.
What is the proper way of relative addressing for cell C14?
Make everything but the last component of the range absolute:
=NPV($B$1, $B$9, $B$14:B14)
I have a formula with the following syntax:
=SheetName!E10
and need some way to drag the formula and change just the sheet name as it moves to the right. So the E10 part needs to stay the same with the sheet number incrementing as I drag the formula. We have many rows and columns to do and this would definitely speed us up.
Is this possible?
So the result would look like this:
=Sheet1!E10 =Sheet2!E10 =Sheet3!E10
This is the result:
from applying this formula:
=INDIRECT("mo"&COLUMN()+0&"!B4")
Please try:
=INDIRECT("Sheet"&COLUMN()+x&"!E10")
where x is the offset to return the appropriate number ( Column()+x ) for wherever you choose to place the formula.
Edit to match subsequent details from the image (where 5 may be in ColumnB) and a comment, perhaps should be:
=INDIRECT("mo"&COLUMN()-1&"!E10")
I have 2 worksheets: Summary and SERVER-ONE.
In cell A5 on the Summary worksheet, I have added the value SERVER-ONE.
Next to it, in cell B5, I would like a formula that uses the value in A5 to display the value of G7 in the worksheet of the same name (SERVER-ONE).
I could manually use:
='SERVER-ONE'!G7
However I would like this to be dynamic, so I can easily add more worksheets.
I tried the obvious with no joy:
='A5'!G7
Any suggestions?
You can use the formula INDIRECT().
This basically takes a string and treats it as a reference. In your case, you would use:
=INDIRECT("'"&A5&"'!G7")
The double quotes are to show that what's inside are strings, and only A5 here is a reference.
You need INDIRECT function:
=INDIRECT("'"&A5&"'!G7")
not sure if you solved your question, but I found this worked to increment the row number upon dragging.
= INDIRECT("'"&$A$5&"'!$G"&7+B1)
Where B1 refers to an index number, starting at 0.
So if you copy-drag both the index cell and the cell with the indirect formula, you'll increment the indirect.
You could probably create a more elegant counter with the Index function too.
Hope this helps.
Here is a solution using INDIRECT, which if you drag the formula, it will pick up different cells from the target sheet accordingly. It uses R1C1 notation and is not limited to working only on columns A-Z.
=INDIRECT("'"&$A$5&"'!R"&ROW()&"C"&COLUMN(),FALSE)
This version picks up the value from the target cell corresponding to the cell where the formula is placed. For example, if you place the formula in 'Summary'!B5 then it will pick up the value from 'SERVER-ONE'!B5, not 'SERVER-ONE'!G7 as specified in the original question. But you could easily add in offsets to the row and column to achieve the desired mapping in any case.
By using the ROW() function I can drag this formula vertically. It can also be dragged horizontally since there is no $ before the D.
= INDIRECT("'"&D$2&"'!$B"&ROW())
My layout has sheet names as column headers (B2, C2, D2, etc.) and maps multiple row values from Column B in each sheet.
INDIRECT is the function you want to use. Like so:
=INDIRECT("'"&A5&"'!G7")
With INDIRECT you can build your formula as a text string.
Guess #user3010492 tested it but I used this with fixed cell A5 --> $A$5 and fixed element of G7 --> $G7
=INDIRECT("'"&$A$5&"'!$G7")
Also works nested nicely in other formula if you enclose it in brackets.
This will only work to column Z, but you can drag this horizontally and vertically.
=INDIRECT("'"&$D$2&"'!"&CHAR((COLUMN()+64))&ROW())