Accessing a cell in a named column

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,525
Office Version
  1. 365
Platform
  1. Windows
In the following table, I need the formulas in columns H & I to refer to the data in column G but at one row down. Column E is assigned the name PP_A, column F the name PP_B, and column G the name Iterations.

I would like to replace the references to column G in the formulas with the name of that column, but if I do, I get the cell in G on the same row as the calling cell.

R/CCDEFGHIJK
5PGS_APGS_BPP_APP_BIterationsWins_AWins_BFormulasFormulas
652.00%50.00%51.35%48.65%61,62058,380H6: =G7*PP_AI6: =G7*PP_B
7120,000
862.00%60.00%51.59%48.41%185,724174,276H8: =G9*PP_AI8: =G9*PP_B
9360,000
1072.00%70.00%52.02%47.98%249,696230,304H10: =G11*PP_AI10: =G11*PP_B
11480,000

<tbody>
</tbody>

I have tried using Cell, Address, Offset, Row, Column and other functions, but have not been able to get anything to work.

Does anyone have any magic I can use?

Thanks
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
if I understood well maybe:
=IF($G6="","",$G6*E5)
and
=IF($G6="","",$G6*F5)
 
Last edited:
Upvote 0
if I understood well maybe:
=IF($G6="","",$G6*E5)
and
=IF($G6="","",$G6*F5)

I don't understand these expressions, but I am trying to eliminate literal cell references (G6, $G6, G$6, or $G$6). I want to replace the "G7" in the expression in H6 with some form of the named range (column) "Iterations". I want the result in H6 to be the product of G7 & E6 but using named ranges, not literal cell addresses.
 
Last edited:
Upvote 0
without any references but with PowerQuery (Get&Transform)

PGS_APGS_BPP_APP_BIterations
52.00%​
50.00%​
51.35%​
48.65%​
120,000​
62.00%​
60.00%​
51.59%​
48.41%​
360,000​
72.00%​
70.00%​
52.02%​
47.98%​
480,000​
PGS_APGS_BPP_APP_BIterationsWins_AWins_B
52.00%​
50.00%​
51.35%​
48.65%​
61620​
58380​
120000​
62.00%​
60.00%​
51.59%​
48.41%​
185724​
174276​
360000​
72.00%​
70.00%​
52.02%​
47.98%​
249696​
230304​
480000​

Code:
[SIZE=1]// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Duplicate = Table.DuplicateColumn(Source, "Iterations", "Iterations - Copy"),
    Fill = Table.FillUp(Duplicate,{"Iterations - Copy"}),
    WinsA = Table.AddColumn(Fill, "Wins_A", each [#"Iterations - Copy"]*[PP_A]),
    WinsB = Table.AddColumn(WinsA, "Wins_B", each [#"Iterations - Copy"]*[PP_B]),
    RC = Table.RemoveColumns(WinsB,{"Iterations - Copy"}),
    Type = Table.TransformColumnTypes(RC,{{"PGS_A", Percentage.Type}, {"PGS_B", Percentage.Type}, {"PP_A", Percentage.Type}, {"PP_B", Percentage.Type}, {"Wins_A", type number}, {"Wins_B", type number}})
in
    Type[/SIZE]

or

PGS_APGS_BPP_APP_BIterationsWins_AWins_B
52.00%​
50.00%​
51.35%​
48.65%​
61620​
58380​
120,000​
62.00%​
60.00%​
51.59%​
48.41%​
185724​
174276​
360,000​
72.00%​
70.00%​
52.02%​
47.98%​
249696​
230304​
480,000​



Code:
[SIZE=1]// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Duplicate = Table.DuplicateColumn(Source, "Iterations", "Iterations - Copy"),
    Fill = Table.FillUp(Duplicate,{"Iterations - Copy"}),
    WinsA = Table.AddColumn(Fill, "Wins_A", each [#"Iterations - Copy"]*[PP_A]),
    WinsB = Table.AddColumn(WinsA, "Wins_B", each [#"Iterations - Copy"]*[PP_B]),
    Type = Table.TransformColumnTypes(WinsB,{{"PGS_A", Percentage.Type}, {"PGS_B", Percentage.Type}, {"PP_A", Percentage.Type}, {"PP_B", Percentage.Type}, {"Wins_A", type number}, {"Wins_B", type number}}),
    ROC = Table.SelectColumns(Type,{"Wins_A", "Wins_B"})
in
    ROC[/SIZE]
 
Last edited:
Upvote 0
without any references but with PowerQuery (Get&Transform)

Wow!!! I'm afraid that is way over my head.

I was able to find a solution along the lines that I can comprehend. This expression eliminates literal cell references (except for the calling cell, which is OK, and uses the named column "Iterations".

Code:
=INDIRECT(ADDRESS(ROW(H6)+1,COLUMN(Iterations)))*PP_A

I was hoping for something simpler, but this will do.

Excel really needs a simpler, more compact cell addressing syntax.
 
Upvote 0
I was able to find a solution along the lines that I can comprehend. This expression eliminates literal cell references (except for the calling cell, which is OK, and uses the named column "Iterations".

Code:
=INDIRECT(ADDRESS(ROW(H6)+1,COLUMN(Iterations)))*PP_A

I was hoping for something simpler, but this will do.
This formula will produce the same result as the one you posted above...

=(7:7 Iterations)*(6:6 PP_A)

Just so you know, the space character as I used it above (with a row reference on one side a column reference on the other side) is the Intersect operator (it retrieves the value at the intersection of that row and column).
 
Last edited:
Upvote 0
This formula will produce the same result as the one you posted above...

=(7:7 Iterations)*(6:6 PP_A)

Just so you know, the space character as I used it above (with a row reference on one side a column reference on the other side) is the Intersect operator (it retrieves the value at the intersection of that row and column).

Perfect. I fiddled around with the Intersect operator, but couldn't get it to work. Thanks!
 
Upvote 0

Forum statistics

Threads
1,214,414
Messages
6,119,375
Members
448,888
Latest member
Arle8907

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top