What does an exclamation mark before a cell reference mean? - excel

In a text about Excel I have read the following:
=SUM(!B1:!K1)
when defining a name for a cell and this was entered into the Refers To field.
What does this mean?

When entered as the reference of a Named range, it refers to range on the sheet the named range is used on.
For example, create a named range MyName refering to =SUM(!B1:!K1)
Place a formula on Sheet1 =MyName. This will sum Sheet1!B1:K1
Now place the same formula (=MyName) on Sheet2. That formula will sum Sheet2!B1:K1
Note: (as pnuts commented) this and the regular SheetName!B1:K1 format are relative, so reference different cells as the =MyName formula is entered into different cells.

If you use that forumla in the name manager you are creating a dynamic range which uses "this sheet" in place of a specific sheet.
As Jerry says, Sheet1!A1 refers to cell A1 on Sheet1. If you create a named range and omit the Sheet1 part you will reference cell A1 on the currently active sheet. (omitting the sheet reference and using it in a cell formula will error).
edit: my bad, I was using $A$1 which will lock it to the A1 cell as above, thanks pnuts :p

Related

Why is INDIRECT() not working on a dynamic named ranged with worksheet scope?

I'm using Excel Office 365. I'm trying to understand why INDIRECT() doesn't work with dynamic named ranges. Here's a screenshot:
In sheets 1, 2, and 3, I have a named range "Item1Price" contain some numbers. In Sheet3, the range with the numbers is defined with an OFFSET formula. Why does this break INDIRECT()? Is there another way to do this?
Thanks
INDIRECT cannot refer to a Dynamic Named Range. Just one more reason I hate INDIRECT.
You can use helper cells.
Depending on your version:
Office 365 or latter put this in the first cell:
=INDEX(Sheet3!$C$3:$E$5,MATCH(Sheet3!$C$11,Sheet3!$B$3:$B$5,0),0)
or if earlier version highlight three cells in a row and put the formula in the formula bar and hit Ctrl-Shift-Enter to array enter.
Then instead of the named range being a variable range assign the helper cells to the named range:
Then you can use your formula:
=SUM(INDIRECT("sheet3!Item1Price"))
And now as the value in C11 changes so does the SUM:
The other option is to skip the INDIRECT completely with CHOOSE:
=CHOOSE(MATCH(A1,{"Sheet1","Sheet2","Sheet3"},0),Sheet1!Item1Price,Sheet2!Item1Price,Sheet3!Item1Price)
This assumes you will have the desired sheet name in A1. This would then use your dynamic range name without problem.

How to create an offset formula to use the reference in a cell (the cell the formula points to), not the cell address the formula is in?

I thought this would be easy, but haven't figured it out on my own or found an existing answer online.
I have a worksheet set up to create charts from the contents of certain cells in a table. I'd like to be able to point one cell to a value in another worksheet and have all the related cell populate with the values using the formula in the one cell as an address reference.
For example, if I put the formula ='Source Data'!G19 in cell E3, I would like cell E4 below it to act like it has the formula ='Source Data'!G20 (one row below in the Source Data worksheet) and populate that value while cell F3 to the right would act like it had the formula ='Source Data'!H20 in it. So the new worksheet would just mirror the table of data from the Source Data worksheet for as many columns or rows as I need.
I'd tried to figure this out with offset, indirect, match and address functions, but have failed.
It is important to note that the formula needs to be able to identify the actual cell address, not just match the value from the formula because the same values show up multiple times in the Source Data worksheet.
Any help or direction is greatly appreciated.
Here's my approach:
I have a workbook with 2 spreadsheets Source Data and Results, on Source Data, I have the "Static" table that contains all my values from A1 to D12(This can be any number of cells, as long as you use an equal range in the Results sheet).
On Results, Cell A1 is reserved for the "guide" cell from Source Data, written in the following format: ''Source Data'!A1 (note the two single quotes at the begging). I chose to start at Cell B2 on the Results sheet, you can switch the formula however you like.
The desired result is achieved by using the following formula on B2:
=IF(CELL("contents",OFFSET(INDIRECT($A$1),ROW(B2)-2,COLUMN(B2)-2))<>0,CELL("contents",OFFSET(INDIRECT($A$1),ROW(B2)-2,COLUMN(B2)-2)),"")
then drag down and to the right the same number of maximum cells that exist on Source Data and the result will adjust accordingly.
I prepared a Google Sheets document with all of the information.

Google Docs - Reference a sheet from cell value

I have a column of "sheet names" and I need to use it to reference the sheets in a formula where I use an interval from these sheets.
How can I do it ?
I found something about indirect() but it seems restricted for single cell reference only.
Thank you
Indirect is not only for single cell reference.
You need it to be typed out like this (if we say you want A1:B10 in Sheet2 when you are in Sheet1):
Sheet2!A1:B10 (in A1), dont use '' around the reference.
=indirect(A1) would then type out the entire range A1:B10 from Sheet2.

Unable to extend VLOOKUP formula

A quick question on VLOOKUP.
I have two sheets ("Sheet2" acting as source or list of elements and "Sheet1" is where the VLOOKUP formula will be used)
I have created a name so that I can reuse the vlookup formula for A2 (Sheet1) also.
The issue is when I drag the formula to B2 in Sheet1 (where I want the VLOOKUP to be applied) it is showing me error and upon inspection I found that the variable I created "qw" is dynamically changing for every row.
See below :
QUESTION :
Can someone tell me how to apply VLOOKUP formula to B2 in Sheet1 ?.
While defining name range you should use the absolute reference for eg. If you want to set the name range to qw then its reference should be like =Sheet1!$A$1:$C$4 which means range get fixed. And if you drag the formula it will refer to same range

How to Make One Cell equal different cell values on multiple sheets and locations

I'm working in Excel 2010, and my question is how do I make a cell (say on one sheet to equal a specific value placed on another sheet). I thought the following formula would do it but it doesn't work.
=IF(COUNTIF(Name,$A2)=1,VLOOKUP($A2,Name,2,FALSE),''))
If I understand your question, you simply want one cell to represent the value of another cell from another sheet? If so, the formula will look like this: =[name of sheet]![cell reference] EG: =sheet2!A1
If used in cell A1 on sheet 1, this would put the value of cell A1 from sheet2 into A1 of sheet 1.
If you modify your question so that you reference the actual sheets & cells you're interested in, I can help you with the formula.
You can easily facilitate this by writing your formula in the bar, then when you need to reference a cell on a different sheet, simply navigate to the sheet & cell to insert it's address into the formula, then carry on with your formula if necessary.

Resources