#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 134
Default Penultimate cell

Hi all

Is there anyway to extract the contents of the penultimate filled cell

Tks in advance
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Penultimate cell

Hi,
In a macro use
penultimatevalue = Cells(Rows.Count, "A").End(xlUp)

On a worksheet for text use
=INDEX(B:B,MATCH(REPT("z",10),B:B,1),1)

for a number number
=INDEX(B:B,MATCH(9.99999999999999E+307,B:B))

if you don't know if its a number or text
=INDIRECT("B"&MAX(IF(NOT(ISBLANK(B1:B100)),ROW(1:1 00))))
Which is an array so Ctrl+Shift+Enter

Mike

"Antonio" wrote:

Hi all

Is there anyway to extract the contents of the penultimate filled cell

Tks in advance

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 134
Default Penultimate cell

Tks for the help....

When I try the formulas, they return the last filled cell, and not the
penultimate... M I missing something???

Tks again

"Mike H" wrote:

Hi,
In a macro use
penultimatevalue = Cells(Rows.Count, "A").End(xlUp)

On a worksheet for text use
=INDEX(B:B,MATCH(REPT("z",10),B:B,1),1)

for a number number
=INDEX(B:B,MATCH(9.99999999999999E+307,B:B))

if you don't know if its a number or text
=INDIRECT("B"&MAX(IF(NOT(ISBLANK(B1:B100)),ROW(1:1 00))))
Which is an array so Ctrl+Shift+Enter

Mike

"Antonio" wrote:

Hi all

Is there anyway to extract the contents of the penultimate filled cell

Tks in advance

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Penultimate cell

=OFFSET(INDEX(B:B,MATCH(99^99,B:B)),-1,0) for the penultimate numeric value

=OFFSET(INDEX(B:B,MATCH(REPT("z",255),B:B)),-1,0) for the penultimate text
value.


Gord Dibben MS Excel MVP

On Fri, 8 Feb 2008 06:23:01 -0800, Antonio
wrote:

Tks for the help....

When I try the formulas, they return the last filled cell, and not the
penultimate... M I missing something???

Tks again

"Mike H" wrote:

Hi,
In a macro use
penultimatevalue = Cells(Rows.Count, "A").End(xlUp)

On a worksheet for text use
=INDEX(B:B,MATCH(REPT("z",10),B:B,1),1)

for a number number
=INDEX(B:B,MATCH(9.99999999999999E+307,B:B))

if you don't know if its a number or text
=INDIRECT("B"&MAX(IF(NOT(ISBLANK(B1:B100)),ROW(1:1 00))))
Which is an array so Ctrl+Shift+Enter

Mike

"Antonio" wrote:

Hi all

Is there anyway to extract the contents of the penultimate filled cell

Tks in advance


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 134
Default Penultimate cell

Tks


"Gord Dibben" wrote:

=OFFSET(INDEX(B:B,MATCH(99^99,B:B)),-1,0) for the penultimate numeric value

=OFFSET(INDEX(B:B,MATCH(REPT("z",255),B:B)),-1,0) for the penultimate text
value.


Gord Dibben MS Excel MVP

On Fri, 8 Feb 2008 06:23:01 -0800, Antonio
wrote:

Tks for the help....

When I try the formulas, they return the last filled cell, and not the
penultimate... M I missing something???

Tks again

"Mike H" wrote:

Hi,
In a macro use
penultimatevalue = Cells(Rows.Count, "A").End(xlUp)

On a worksheet for text use
=INDEX(B:B,MATCH(REPT("z",10),B:B,1),1)

for a number number
=INDEX(B:B,MATCH(9.99999999999999E+307,B:B))

if you don't know if its a number or text
=INDIRECT("B"&MAX(IF(NOT(ISBLANK(B1:B100)),ROW(1:1 00))))
Which is an array so Ctrl+Shift+Enter

Mike

"Antonio" wrote:

Hi all

Is there anyway to extract the contents of the penultimate filled cell

Tks in advance





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Penultimate cell

On Fri, 8 Feb 2008 04:26:04 -0800, Mike H
wrote:

Hi,
In a macro use
penultimatevalue = Cells(Rows.Count, "A").End(xlUp)

On a worksheet for text use
=INDEX(B:B,MATCH(REPT("z",10),B:B,1),1)

for a number number
=INDEX(B:B,MATCH(9.99999999999999E+307,B:B))

if you don't know if its a number or text
=INDIRECT("B"&MAX(IF(NOT(ISBLANK(B1:B100)),ROW(1: 100))))
Which is an array so Ctrl+Shift+Enter

Mike


Definition of penultimate: Next to Last

Your formulas return the LAST value.
--ron
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Penultimate cell

When I try the formulas, they return the last filled cell,
and not the penultimate...


Which formula did you try?

How about giving us some more detailed info, like:

Where to look for this value. Is it in the range A1:A100? Is it in the range
B10:AJ10?

What type of data are we looking for? Is it a text value? Is it a numeric
value?

Will the range to look in contain only one data type? Is it text or is it
numeric? Can it be both?

Are there any empty/blank cells in the range we need to look in?

Are there any formulas in this range that return blank cells?


--
Biff
Microsoft Excel MVP


"Antonio" wrote in message
...
Hi all

Is there anyway to extract the contents of the penultimate filled cell

Tks in advance



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Penultimate cell

On Fri, 8 Feb 2008 04:01:00 -0800, Antonio
wrote:

Hi all

Is there anyway to extract the contents of the penultimate filled cell

Tks in advance


Yes there is. But it depends on how your data is organized.

If your data is in column A, is contiguous (no blank spaces), then:

=OFFSET(A1,COUNTA(A:A)-2,0)

If your data is organized differently, then the method will be different.
--ron
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Penultimate cell

On Fri, 08 Feb 2008 19:27:12 -0500, Ron Rosenfeld
wrote:

On Fri, 8 Feb 2008 04:01:00 -0800, Antonio
wrote:

Hi all

Is there anyway to extract the contents of the penultimate filled cell

Tks in advance


Yes there is. But it depends on how your data is organized.

If your data is in column A, is contiguous (no blank spaces), then:

=OFFSET(A1,COUNTA(A:A)-2,0)

If your data is organized differently, then the method will be different.
--ron


Actually, Gord's formulas are probably better.
--ron
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
MATCH Multiple Criteria & Return Previous / Penultimate Match Sam via OfficeKB.com Excel Worksheet Functions 27 October 6th 07 01:39 AM
How can I make a blank cell in a formula cell with a range of cell Vi Excel Discussion (Misc queries) 5 June 21st 07 02:46 PM
How to create/run "cell A equals Cell B put Cell C info in Cell D abmb161 Excel Discussion (Misc queries) 5 January 26th 06 06:36 PM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 1 February 11th 05 06:36 AM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 0 February 11th 05 05:35 AM


All times are GMT +1. The time now is 06:37 PM.

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

About Us

"It's about Microsoft Excel"