Row reference in a formula when the row can move about.

Eamonn100

Board Regular
Joined
Nov 12, 2015
Messages
156
Hi,

I'm using =VLOOKUP("Fiscal Period ",$A:$AB,COUNTA(1:1),0) to find the end of a row. The problem is sometimes Fiscal Period isn't in row 1:1. Is there away for me to reference what ever row reference Fiscal Period is in. e.g. If Fiscal Period was in row 5:5 my formula would be =VLOOKUP("Fiscal Period ",$A:$AB,COUNTA(5:5),0)

Below is a formula for returning the row reference but it's not working properly when I incert it into the main formula, e.g. =VLOOKUP("Fiscal Period ",$A:$AB,COUNTA(MATCH("Fiscal Period ",A:A,0)&":"&MATCH("Fiscal Period ",A:A,0)),0)

=MATCH("Fiscal Period ",A:A,0)&":"&MATCH("Fiscal Period ",A:A,0) This on it's own returns It returns 1:1.

[TABLE="width: 1921"]
<tbody>[TR]
[TD][/TD]
[TD]a[/TD]
[TD]b[/TD]
[TD]c[/TD]
[TD]d[/TD]
[TD]e[/TD]
[TD]f[/TD]
[TD]g[/TD]
[TD]h[/TD]
[TD]i[/TD]
[TD]j[/TD]
[TD]k[/TD]
[TD]l[/TD]
[TD]m[/TD]
[TD]n[/TD]
[TD]o[/TD]
[TD]p[/TD]
[TD]q[/TD]
[TD]r[/TD]
[TD]s[/TD]
[TD]t[/TD]
[TD]u[/TD]
[TD]v[/TD]
[TD]w[/TD]
[TD]x[/TD]
[TD]y[/TD]
[TD]z[/TD]
[TD]aa[/TD]
[TD]ab[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Fiscal Period[/TD]
[TD="align: right"]Dec-05[/TD]
[TD="align: right"]Dec-06[/TD]
[TD="align: right"]Dec-07[/TD]
[TD="align: right"]Dec-08[/TD]
[TD="align: right"]Dec-09[/TD]
[TD="align: right"]Sep-10[/TD]
[TD="align: right"]Sep-11[/TD]
[TD="align: right"]Sep-12[/TD]
[TD="align: right"]Sep-13[/TD]
[TD="align: right"]Sep-14[/TD]
[TD="align: right"]Dec-15[/TD]
[TD]TTM/current[/TD]
[TD][/TD]
[TD="align: right"]Mar-13[/TD]
[TD="align: right"]Jun-13[/TD]
[TD="align: right"]Sep-13[/TD]
[TD="align: right"]Dec-13[/TD]
[TD="align: right"]Mar-14[/TD]
[TD="align: right"]Jun-14[/TD]
[TD="align: right"]Sep-14[/TD]
[TD="align: right"]Mar-15[/TD]
[TD="align: right"]Jun-15[/TD]
[TD="align: right"]Sep-15[/TD]
[TD="align: right"]Dec-15[/TD]
[TD="align: right"]Mar-16[/TD]
[TD="align: right"]Jun-16[/TD]
[TD="align: right"]Sep-16[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I've found out that my formula works fine when on the same sheet as the information but when I try to use it from another sheet (as I have a copy/paste sheet for the information and a working out sheet for formulas I use to extract the info I need) it doesn't work properly.

Can anyone see why this would work when on the same sheet but not when it's on a different sheet to the info?

Prehapes a simpler way to find the row reference than my formula. =MATCH("Fiscal Period ",A:A,0)&":"&MATCH("Fiscal Period ",A:A,0)
 
Upvote 0
Hi,

I'm using =VLOOKUP("Fiscal Period ",$A:$AB,COUNTA(1:1),0) to find the end of a row. The problem is sometimes Fiscal Period isn't in row 1:1. Is there away for me to reference what ever row reference Fiscal Period is in. e.g. If Fiscal Period was in row 5:5 my formula would be =VLOOKUP("Fiscal Period ",$A:$AB,COUNTA(5:5),0)

Below is a formula for returning the row reference but it's not working properly when I incert it into the main formula, e.g. =VLOOKUP("Fiscal Period ",$A:$AB,COUNTA(MATCH("Fiscal Period ",A:A,0)&":"&MATCH("Fiscal Period ",A:A,0)),0)

=MATCH("Fiscal Period ",A:A,0)&":"&MATCH("Fiscal Period ",A:A,0) This on it's own returns It returns 1:1.

[TABLE="width: 1921"]
<tbody>[TR]
[TD][/TD]
[TD]a[/TD]
[TD]b[/TD]
[TD]c[/TD]
[TD]d[/TD]
[TD]e[/TD]
[TD]f[/TD]
[TD]g[/TD]
[TD]h[/TD]
[TD]i[/TD]
[TD]j[/TD]
[TD]k[/TD]
[TD]l[/TD]
[TD]m[/TD]
[TD]n[/TD]
[TD]o[/TD]
[TD]p[/TD]
[TD]q[/TD]
[TD]r[/TD]
[TD]s[/TD]
[TD]t[/TD]
[TD]u[/TD]
[TD]v[/TD]
[TD]w[/TD]
[TD]x[/TD]
[TD]y[/TD]
[TD]z[/TD]
[TD]aa[/TD]
[TD]ab[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Fiscal Period[/TD]
[TD="align: right"]Dec-05[/TD]
[TD="align: right"]Dec-06[/TD]
[TD="align: right"]Dec-07[/TD]
[TD="align: right"]Dec-08[/TD]
[TD="align: right"]Dec-09[/TD]
[TD="align: right"]Sep-10[/TD]
[TD="align: right"]Sep-11[/TD]
[TD="align: right"]Sep-12[/TD]
[TD="align: right"]Sep-13[/TD]
[TD="align: right"]Sep-14[/TD]
[TD="align: right"]Dec-15[/TD]
[TD]TTM/current[/TD]
[TD][/TD]
[TD="align: right"]Mar-13[/TD]
[TD="align: right"]Jun-13[/TD]
[TD="align: right"]Sep-13[/TD]
[TD="align: right"]Dec-13[/TD]
[TD="align: right"]Mar-14[/TD]
[TD="align: right"]Jun-14[/TD]
[TD="align: right"]Sep-14[/TD]
[TD="align: right"]Mar-15[/TD]
[TD="align: right"]Jun-15[/TD]
[TD="align: right"]Sep-15[/TD]
[TD="align: right"]Dec-15[/TD]
[TD="align: right"]Mar-16[/TD]
[TD="align: right"]Jun-16[/TD]
[TD="align: right"]Sep-16[/TD]
[/TR]
</tbody>[/TABLE]


Edit
The first formula should read. =VLOOKUP("Fiscal Period ",$A:$AB,COUNTA(INDIRECT(MATCH("Fiscal Period ",A:A,0)&":"&MATCH("Fiscal Period ",A:A,0))),0)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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