Hi I created a formula involving an offset function in a cell and dragged it over covering more than a hundred cells, my problem is i need to define each formula in a name manager. Is there a way I can do it automatically?
Related
I have three excel sheets that are set out the same (they are filled with the same tables but have different values). I have now created another excel sheet which is suppose to sum the values at each cell. For example, take cell G10. All values in this particular cell, across these three excel spreadsheets are summed and presented in this new summary excel sheet. I have created the following ‘indirect’ formula to do it. (I want to use indirect formula as it refers to the name of each worksheet. It is appropriate for this workflow).
Equation (at cell G15)
=SUM((INDIRECT($G$2&"!G15:AV15",TRUE)),(INDIRECT($G$3&"!G15:AV15",TRUE),(INDIRECT($G$4&"!G15:AV15",TRUE))))
($G$2, $G$3,$G$4refers to the worksheet name;
G15:AV15 refers to the particular range…)
The formula works for the particular row, however I want to be able to copy and paste this formula to other cells below and get excel to recognise and change the row number accordingly…
Ie when I copy this formulae to cell value G20, I would want the formula change to reference “G20:AV20.” Does anyone have any recommendations??
I understand that excel is not the best tool for this project, but I have been told it is the tool I will use for this.
I have a workbook where one worksheet is compiling data from 4 other workbooks into a single table. Every year we have to build a new set of workbooks, etc.
If cell E2 has the formula:
=IFERROR(GETPIVOTDATA("BATCH #",'[2019 Q1 Data Sheet.xlsm]Q1W1'!$A$1),0)
and Cell E3 has the formula:
=IFERROR(GETPIVOTDATA("BATCH #",'[2019 Q1 Data Sheet.xlsm]Q1W2'!$A$1),0)
Is it possible to rewrite these formulas so that the "Q#W#" portion of it is determined by the value in cell A12 and A3?
The way this project was set up resulted in there being more than 52 weeks in the year (yeah I know it's not the best design but it is what I was handed).
So I would like to have a formula where the Q#W# portion is dynamic, and the value in that part of the formula is located in a different cell so we can easily change the formulas every year as opposed to changing each cell one at a time. I've tried a macro find and replace for some of this project but for this part I'm not sure how to make it work.
You can get the name of the worksheets with
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
Then use CONCAT to define the worksheet of interest (the reference to Q#W#) in the formula to pull the data from.
I am trying to create a graph with the help of Name Manage. I have come up with the following formula to create the series of numbers required by me. The formula is:
Sheet2!B4:INDIRECT(ADDRESS(4,Sheet3!AM11,4,,"Sheet2"))
When I input this formula into the cell it works properly and provide me with required series, but when I create the name(using name manager) of the series with the same formula and try the create the graph the excel throws the following error:
Several things:
thing one: you are using relative cell references in the named formula. That means that wherever the active cell is, the named formula will recalculate based on the current cell. B4 will change to any cell based on the current cell. Use absolute references like $B$4if you want to anchor a certain cell as a base reference.
Thing two: Indirect with a complicated nesting of functions that reveal a row and/or column can be replaced by a more efficient Index formula.
Thing one is probably the thing that causes your problems, because the result of the formula will change with the selected cell.
Edit after inspecting the workbook
The problem is definitely the relative cell references, and making them absolute definitely solves the problem. Your formula was defined with the active cell in B10 and it is
=Sheet1!B1:INDIRECT(ADDRESS(1,Sheet1!D10,4))
But when the active cell is in A1, for example, the formula changes to
=Sheet1!A1048568:INDIRECT(ADDRESS(1,Sheet1!C1,4))
Every time you click on a cell, the named formula will recalculate based on the position of the current cell. That's why you need absolute references. You can correct your formula to
=Sheet1!$B$1:INDIRECT(ADDRESS(1,Sheet1!$D$10,4))
Or you can use Index instead of Indirect this way:
=Sheet1!$B$1:INDEX(Sheet1!$1:$1,Sheet1!$D$10)
Or you can use a simple Offset function
=OFFSET(Sheet1!$B$1,0,0,1,Sheet1!$D$10-1)
Whichever formula you prefer, this will always deliver the correct range, no matter which cell is the active cell.
Once you have the date range in place, you can use a simple offset from the date range to get the series ranges.
Offset by one row for Open, offset by two rows for High, etc.
=OFFSET(Date,1,0)
The screenshot shows the Date formula with the Offset function and you can see the formulas used for the Open, High, Low, and AdjClose names. The chart shows the series Open and AdjClose. Note how the marching ants highlight the current extent of the named range. The Date name will always refer to a range starting in B1 because that cell is anchored with an absolute reference.
If you have any questions about that, pipe up.
I was hoping someone could offer me a little help please on a formula. In one of my cells I use a vlookup to search for the colour in B12 and match it to the colour on another worksheet called cars.
Now this works perfectly fine, but after running the formula I have to select the last row of data and press control & d, or drag down the cell up until the last cell, my question is that is it possible to add this forumla into the cell and have it automatically run all the way down to the last row of data? my forumula is
=VLOOKUP(B12,coloursc:carsc,2)
You can use an Excel table for your data entry. Formulas and formatting will automatically be applied to any new row in the table. You no longer need to manually copy down or pre-fill empty areas of the spreadsheet with formulas.
Learn more about tables in this Microsoft article and this tutorial on Contextures.com
In Excel 2007 I use the following formula to refer to cells in other worksheets in the same workbook:
=INDIRECT($B$2&"!A9")
B2 contains the name of the worksheet containing the target cells (I want to turn this into a template, so I don't enter the name into the formula). The formula works, but I want to use this same formula over multiple rows (A10, A11, A12 [...] A1000). I am using this same code over multiple rows but with different fields (B9, C9 and so on), with a variety of different content types (data, number, text).
An alternate version of the formula is as follows:
='Worksheetname'!A9
But again, this requires hard-coding the name of the worksheet, which is not desirable for me.
Because of the sheer volume of the rows manual editing is not an option: is there any way to alter this formula so I can easily use it over multiple rows? Preferably without the use of VBA, but that is not a requirement.
If your records are located in the same cells in both worksheets, then you can use something like following:
=INDIRECT($B$2&"!"&ADDRESS(ROW();COLUMN()))
IF now, then you can easily offset them using given ADDRESS function
P.S. Please be aware with INDIRECT function that it slows down calculation performance on your workbook (few functions are OK, but if you have 10,000 of them then you might see some delay)
If you want to use the same formulas for several columns as well you could include something like this:
=INDIRECT("'"&$B$2&"'!"&ADDRESS(MATCH($B4;INDIRECT(CONCATENATE ($B$2;"!";"B:B"));0);MATCH(B$3;INDIRECT(CONCATENATE($D$2;"!";"A3:AR3"));0)))
B2=reference to sheet name
B4=first row for your data
B3=Column header
For those who want to pull all the same column of data from multiple sheet that have the same layout (and have each cell linked), it took me hours to work it out, but actually can be solved with a relatively simple way:
=OFFSET(INDIRECT("'"&G$2&"'!l7"),$A6,0,1,1)
The Indirect part take you to the right sheet and right cell, G2, H2 ... has the Sheet names (be mindful of sheet name with space, you will need to use ' ', which is the case for my workbook), and L7 cell of that sheet, and I want L8, L9, ----L200 all being pulled through;
Offset help you navigate the range of rows, A6 is an additional numbering row I added to move to the right row in each sheet.
Hope it help!