Excel: OFFSET Formula in Name Manager - excel

I defined names for frequently used formulas like below:
pointer =DataSheet!$A$1
sh1X0 =OFFSET(DataSheet!C7,0,0,DataSheet!pointer+1,1)
sh1X0 =OFFSET(DataSheet!F7,0,0,DataSheet!pointer+1,1)
I close the Name Manager.
I am using them to make chart series.
Everything works fine.
So far the active cell is B4.
I select a different cell, say B5, all the offset formulas are changing (getting corrupted) relative to the selected range.
The above mentioned formulas change to:
sh1X0 =OFFSET(DataSheet!C8,0,0,DataSheet!pointer+1,1)
sh1X0 =OFFSET(DataSheet!F8,0,0,DataSheet!pointer+1,1)
If C5 is the selection, then
sh1X0 =OFFSET(DataSheet!D8,0,0,DataSheet!pointer+1,1)
sh1X0 =OFFSET(DataSheet!G8,0,0,DataSheet!pointer+1,1)
Why are the formulas changing?
How can they be kept independent from the selection of the cell?

As you said, your formulas are relative. You need to make them absolute by using dollar signs, e.g.:
sh1X0 =OFFSET(DataSheet!$C$7,0,0,DataSheet!pointer+1,1)
Note that you can select the C7 part and hit F4 a couple of times to get the dollar signs right.
This Jan Karel Pieterse page has an explanation of absolute and relative references in defined names.

Related

Trying to display the literal value of a concatenated cell in another cell

I'm having trouble phrasing my question, so here's a screenshot. Basically I want G2 to be a field I can copy and paste into a field on a website for billing purposes. The TEXTJOIN function is the closest I've gotten to making this work but it still isn't right. I'm having the following problems:
The price of each fruit loses its ending 0's during concatenation
I intend to keep adding more fruits, but =TEXTJOIN(E:E) includes E1 which is obviously the heading
The resulting string in G2 isn't copy-and-paste-able without first copying and selecting Paste Value within Excel
Screenshot for reference:
I might not be able to avoid the last problem without VBA but I'd like to at least navigate around the first 2 issues. I suppose creating a button that would output G2's value to a Notepad document would work as well, or something along those lines.
In E2 put:
=A2&"("&TEXT(D2,"$#,##0.00")&")"
to do the concatenation.
Then just specify the start in E2:
=TEXTJOIN(", ",TRUE,E2:E1040000)
Also you can skip the helper columns with the following array version of TEXTJOIN:
=TEXTJOIN(", ",TRUE,$A$2:INDEX(A:A,MATCH("zzz",A:A))&"("&TEXT($D$2:INDEX(D:D,MATCH("zzz",A:A)),"$#,##0.00")&")")
Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
When you copy a cell to the clipboard and paste it anywhere but Excel it should only paste the text, but that may depend on the website also.

Wrong cell when conditional formatting with values

I regularly encounter an issue on Excel 2010 when I create a new rule using a formula. The issue is reproducible on several of my computers. I select several cells (for instance A4:B143) and then create a new rule using one of the following formulas:
=$A4="issue"
=($A4="issue")
then press Enter. The goal is, of course, to see all the rows of which the first cell's value is "issue". But this does not work and when I go to "manage rules", I see that Excel has the following formula:
=$A1048441="issue"
This is the formula that I want but not with the number that I entered. If I manually replace this new formula that comes out of nowhere (in my eyes) with my old formula, everything works correctly and the formula stays =$A4="issue".
Does anyone know what might cause this issue?
Please try selecting from top left to bottom right rather than vice versa.
Without the anchor ($) for rows (has to be left off for the one formula rule to apply throughout the range) the row references are relative - but relative to the active cell rather than to the top row.
The active cell when selecting a range is the one that starts the range selection. So a range that is selected from B143 to A4 has B143 as the active cell (not A4). Relative to that Row4 is 139 rows earlier. For CF, 139 rows earlier than A4 is Row1048441 in Excel 2010 (the rows 'wrap' - the last row, Row1048576, is in effect immediately before Row1, so Row1048441 + 136 gets back to Row1 and plus another 3 from there to get to Row4. 136+3 is the 139 difference).
I was able to do apply it in the following manner:
When I entered the formula, I did not put an = sign before. I just put $a6=issue
Rules:
Data:

Formula on Cell changes when I drag it down in excel

I have a formula which goes like the one below
=COUNTIF(D10:D1000,Q13)
But everytime I drag it down D10 becomes D11. All I want to change is Q13 to Q14 to Q15 and so on but not the D10. So the above formula is for Q13 and in Q14 I want the formula to be
=COUNTIF(D10:D1000,Q14)
And for Q15
=COUNTIF(D10:D1000,Q15)
Notice that D10 doesn't change but Q+value does.
Kindly advice, Thanks.
Lock the range. This can be done by adding dollar signs before the references (or pressing F4 after typing/selecting the range:
=COUNTIF($D$10:$D$1000,Q13)
Though in this situation locking the row should be enough, since you're dragging down, the D won't change (you can add the dollar signs where required, or press F4 repeatedly until you get the right lock):
=COUNTIF(D$10:D$1000,Q13)
If you want D10 to stay the same specify an absolute reference using $, like this:
=COUNTIF($D$10:D1000,Q13)

How to avoid manually entering this formula in Excel

I'm trying to calculate a value called, "additional throughput". It is calculated by subtracting the base case module's throughput from a new module's throughput.
In the sheet below you can see that for the third row down (has a blue box in it), that the additional throughput is calculated by the formula "=T6-T4".
The problem is that when I click on this box and drag it down to apply the same formula to the other rows, I want the formula to become "=T7-T4" for the next row. Instead it becomes "=T7-T5". I tried to select multiple cells (where the formula was manually entered) before dragging down so it could recognize that the T4 doesn't change, only the first part. However, that didn't work.
In Excel you can use $ signs before the column or row references to make those references "absolute" (rather than "relative"). For example if you use =A$1 then the 1 doesn't change when you copy down. If you use =$A1 then the A doesn't change when you copy across. If you use =$A$1 then neither changes whichever way you go.
So for your case you need to use
=T6-T$4
when you copy that down T$4 doesn't change
You have to make the cell address of T4absolute by pressing F4, so it becomes $T$4. When you then copy the formular to other places T4 will keep its absolute address.
I figured it out.
You put a $ symbol in front of the row and column you want to not change. This is referred to as an absolute reference.
Found out how to do it here:
How do I change an Excel relative cell to an absolute cell?

Excel Dynamic Ranges changing (with no logic)

A confusing one. I'm using a dynamic range
=OFFSET('EA OPs'!A4,0,0,COUNTA('EA OPs'!$A:$A)-1,96)
I've assigned it to rOps in the NAME MANAGER. I've then tried to change a Pivot Table source to rOps. Click in to a random cell. Click back in the NAME MANAGER and it has changed to:
=OFFSET('EA OPs'!G3,0,0,COUNTA('EA OPs'!$A:$A)-1,96)
then
=OFFSET('EA OPs'!G24,0,0,COUNTA('EA OPs'!$A:$A)-1,96)
seemingly at random. Althought it does seem to keep near to the cell I've clicked on?
Any ideas?
You need to anchor the A4 with dollar signs and make it an absolute reference. Otherwise it's relative to whatever cell is active:
=OFFSET('EA OPs'!$A$4,0,0,COUNTA('EA OPs'!$A:$A)-1,96)
Named ranges always behave this way, which can be useful. For example with A2 active, you can create a range named "CellAbove" and set it to "=A1". You can then use it in a formula in any cell, e.g., `=CellAbove/2' and the result will be the value of the cell one row up, divided by 2.

Resources