Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default fin last row withtin a range using built functions not VBA

I have blocks of data in a sheet, every time there is an entry in column A a
new range begins and (in terms of rows) goes as far as until there is another
entry in Column A.

All the entries in Column A are in A9 with "validation data list" i need to
retireve the last row of the range of the selected entry using built in
formulas.

I have this to get the first row and it works
=MATCH( A9,$A$41:$A$10000,0)+40

Need the one to find the last row of that range which is delimited by the
next entry in ColA
Thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default fin last row withtin a range using built functions not VBA

Luis,

If the values are contiguous, then the simplest to use and understand would
be

=MATCH(A9,$A$41:$A$10000,0)+COUNTIF($A$40:$A$10000 ,A9)+39

If they are not contiguous, then array enter (enter using Ctrl-Shift-Enter)

=MAX(($A$40:$A$10000=A9)*ROW($A$40:$A$10000))

HTH,
Bernie
MS Excel MVP


"LuisE" wrote in message
...
I have blocks of data in a sheet, every time there is an entry in column A
a
new range begins and (in terms of rows) goes as far as until there is
another
entry in Column A.

All the entries in Column A are in A9 with "validation data list" i need
to
retireve the last row of the range of the selected entry using built in
formulas.

I have this to get the first row and it works
=MATCH( A9,$A$41:$A$10000,0)+40

Need the one to find the last row of that range which is delimited by the
next entry in ColA
Thanks in advance


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default fin last row withtin a range using built functions not VBA

And I should have noted that you might want to change the +40 and the +39 in
your formula and in my first formula to

ROW($A$41)-1 or ROW($A$41)-2

to make the formulas properly respond to row insertions or deletions in the
range A1:A40.

Bernie


"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Luis,

If the values are contiguous, then the simplest to use and understand
would be

=MATCH(A9,$A$41:$A$10000,0)+COUNTIF($A$40:$A$10000 ,A9)+39

If they are not contiguous, then array enter (enter using
Ctrl-Shift-Enter)

=MAX(($A$40:$A$10000=A9)*ROW($A$40:$A$10000))

HTH,
Bernie
MS Excel MVP


"LuisE" wrote in message
...
I have blocks of data in a sheet, every time there is an entry in column A
a
new range begins and (in terms of rows) goes as far as until there is
another
entry in Column A.

All the entries in Column A are in A9 with "validation data list" i need
to
retireve the last row of the range of the selected entry using built in
formulas.

I have this to get the first row and it works
=MATCH( A9,$A$41:$A$10000,0)+40

Need the one to find the last row of that range which is delimited by the
next entry in ColA
Thanks in advance



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default fin last row withtin a range using built functions not VBA

Thanks Bernie

"Bernie Deitrick" wrote:

And I should have noted that you might want to change the +40 and the +39 in
your formula and in my first formula to

ROW($A$41)-1 or ROW($A$41)-2

to make the formulas properly respond to row insertions or deletions in the
range A1:A40.

Bernie


"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Luis,

If the values are contiguous, then the simplest to use and understand
would be

=MATCH(A9,$A$41:$A$10000,0)+COUNTIF($A$40:$A$10000 ,A9)+39

If they are not contiguous, then array enter (enter using
Ctrl-Shift-Enter)

=MAX(($A$40:$A$10000=A9)*ROW($A$40:$A$10000))

HTH,
Bernie
MS Excel MVP


"LuisE" wrote in message
...
I have blocks of data in a sheet, every time there is an entry in column A
a
new range begins and (in terms of rows) goes as far as until there is
another
entry in Column A.

All the entries in Column A are in A9 with "validation data list" i need
to
retireve the last row of the range of the selected entry using built in
formulas.

I have this to get the first row and it works
=MATCH( A9,$A$41:$A$10000,0)+40

Need the one to find the last row of that range which is delimited by the
next entry in ColA
Thanks in advance




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default fin last row withtin a range using built functions not VBA

Bernie,

What if I need to find the corresponding last cell in the next Column (B).
in other words, the last non empty cell in B begining from the last non empty
row in A

Thanks in advance

"LuisE" wrote:

I have blocks of data in a sheet, every time there is an entry in column A a
new range begins and (in terms of rows) goes as far as until there is another
entry in Column A.

All the entries in Column A are in A9 with "validation data list" i need to
retireve the last row of the range of the selected entry using built in
formulas.

I have this to get the first row and it works
=MATCH( A9,$A$41:$A$10000,0)+40

Need the one to find the last row of that range which is delimited by the
next entry in ColA
Thanks in advance



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default fin last row withtin a range using built functions not VBA

Luis,

You need to better describe your worksheet's structure, but a solution is
possible...

HTH,
Bernie

"LuisE" wrote in message
...
Bernie,

What if I need to find the corresponding last cell in the next Column (B).
in other words, the last non empty cell in B begining from the last non
empty
row in A

Thanks in advance

"LuisE" wrote:

I have blocks of data in a sheet, every time there is an entry in column
A a
new range begins and (in terms of rows) goes as far as until there is
another
entry in Column A.

All the entries in Column A are in A9 with "validation data list" i need
to
retireve the last row of the range of the selected entry using built in
formulas.

I have this to get the first row and it works
=MATCH( A9,$A$41:$A$10000,0)+40

Need the one to find the last row of that range which is delimited by the
next entry in ColA
Thanks in advance


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default fin last row withtin a range using built functions not VBA

Bernie,
Thanks again for your help and patience.

Let's say that te following ranges hold my data

"A50" "B50:F60"
"A63" "B63:F80"
"A100" "B100:F135"

In "A1" I have a validation list with the contents of ColA (it works just
fine)
In "A2" I have a formula that returns the row number (in"A50:A100") of the
selected value in A1. It works just fine.

In "A3" I need a formula to return the last row in ColF associated to the
selectd value in A1. ie:

if A1 show the value of A50 then A2=50 A3=60
if A1 show the value of A63 then A2=63 A3=80
if A1 show the value of A100 then A2=100 A3=135

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default fin last row withtin a range using built functions not VBA

Luis,

In A2, array enter (enter using Ctrl-Shift-Enter) the formula

=MIN(IF(OFFSET($F$1,MAX((A3:A10000=A1)*ROW(A3:A100 00))-1,0,10000,1)="",
ROW(OFFSET($F$1,MAX((A3:A10000=A1)*ROW(A3:A10000))-1,0,10000,1)),10001))-1

HTH,
Bernie
MS Excel MVP


"LuisE" wrote in message
...
Bernie,
Thanks again for your help and patience.

Let's say that te following ranges hold my data

"A50" "B50:F60"
"A63" "B63:F80"
"A100" "B100:F135"

In "A1" I have a validation list with the contents of ColA (it works just
fine)
In "A2" I have a formula that returns the row number (in"A50:A100") of
the
selected value in A1. It works just fine.

In "A3" I need a formula to return the last row in ColF associated to the
selectd value in A1. ie:

if A1 show the value of A50 then A2=50 A3=60
if A1 show the value of A63 then A2=63 A3=80
if A1 show the value of A100 then A2=100 A3=135


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Built in Functions in VB Code Jim Conrady Excel Programming 4 August 19th 06 04:29 PM
Can I do this with built in functions? Conan Kelly Excel Worksheet Functions 3 December 6th 05 08:52 PM
Viewing built-in functions Jim[_36_] Excel Programming 1 December 29th 03 07:56 PM
Viewing built-in functions Jim[_36_] Excel Programming 2 December 29th 03 12:59 PM
Using Built in Functions in VBA Code Chris Parker Excel Programming 1 July 16th 03 05:42 PM


All times are GMT +1. The time now is 06:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"