Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
jfp jfp is offline
external usenet poster
 
Posts: 4
Default selecting the penultimate cell from a column of data

=IF(ISERROR(MATCH(9.999999E+306,A:A)),MATCH("*",A: A,-1),
IF(ISERROR(MATCH("*",A:A,-1)),MATCH(9.999999E+306,A:A),
MAX(MATCH(9.999999E+306,A:A),MATCH("*",A:A,-1))))

I have the above function which allows me to select the final data I have
inputted. What do I need to add in order to get the last but one piece of
data? Is this possible?

I create tables which have todays price, last weeks price and the price from
the corresponding week last year too (so having the option for 52 cells above
the last one would also be useful). These prices are all listed in a table
which I then need to summarise - hence the request.

Many thanks

James
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default selecting the penultimate cell from a column of data

Hi,

Your formula is returning the row number so putting -1 on the end will
return the row number of the second to last row. You could use this instead
which does the same

=SUMPRODUCT(MAX((ROW(A1:A1000))*(A1:A1000<"")))-1

Mike

"jfp" wrote:

=IF(ISERROR(MATCH(9.999999E+306,A:A)),MATCH("*",A: A,-1),
IF(ISERROR(MATCH("*",A:A,-1)),MATCH(9.999999E+306,A:A),
MAX(MATCH(9.999999E+306,A:A),MATCH("*",A:A,-1))))

I have the above function which allows me to select the final data I have
inputted. What do I need to add in order to get the last but one piece of
data? Is this possible?

I create tables which have todays price, last weeks price and the price from
the corresponding week last year too (so having the option for 52 cells above
the last one would also be useful). These prices are all listed in a table
which I then need to summarise - hence the request.

Many thanks

James

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default selecting the penultimate cell from a column of data

The below array formula will return the last but one row number in ColA with
an entry. Please note that this is an array formula. Within the cell in edit
mode (F2) paste this formula and press Ctrl+Shift+Enter to apply this
formula. If successful in 'Formula Bar' you can notice the curly braces at
both ends like "{=<formula}"

=LARGE(IF(A1:A1000<"",ROW(A1:A1000)),2)

If this post helps click Yes
---------------
Jacob Skaria


"jfp" wrote:

=IF(ISERROR(MATCH(9.999999E+306,A:A)),MATCH("*",A: A,-1),
IF(ISERROR(MATCH("*",A:A,-1)),MATCH(9.999999E+306,A:A),
MAX(MATCH(9.999999E+306,A:A),MATCH("*",A:A,-1))))

I have the above function which allows me to select the final data I have
inputted. What do I need to add in order to get the last but one piece of
data? Is this possible?

I create tables which have todays price, last weeks price and the price from
the corresponding week last year too (so having the option for 52 cells above
the last one would also be useful). These prices are all listed in a table
which I then need to summarise - hence the request.

Many thanks

James

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
jfp jfp is offline
external usenet poster
 
Posts: 4
Default selecting the penultimate cell from a column of data

Thank you for those ... sorry, I copied the original suggestion which gives
the row number as my formula is actually below(with an INDEX in order to give
the value of the cell). I'll see if the suggestions still works .

=INDEX('[QMS Data
Spreadsheet.xls]Cattle'!R:R,IF(ISERROR(MATCH(9.999999E+306,'[QMS Data
Spreadsheet.xls]Cattle'!R:R)),MATCH("*",'[QMS Data
Spreadsheet.xls]Cattle'!R:R,-1),IF(ISERROR(MATCH("*",'[QMS Data
Spreadsheet.xls]Cattle'!R:R,-1)),MATCH(9.999999E+306,'[QMS Data
Spreadsheet.xls]Cattle'!R:R),MAX(MATCH(9.999999E+306,'[QMS Data
Spreadsheet.xls]Cattle'!R:R),MATCH("*",'[QMS Data
Spreadsheet.xls]Cattle'!R:R,-1)))))

Thanks



"Jacob Skaria" wrote:

The below array formula will return the last but one row number in ColA with
an entry. Please note that this is an array formula. Within the cell in edit
mode (F2) paste this formula and press Ctrl+Shift+Enter to apply this
formula. If successful in 'Formula Bar' you can notice the curly braces at
both ends like "{=<formula}"

=LARGE(IF(A1:A1000<"",ROW(A1:A1000)),2)

If this post helps click Yes
---------------
Jacob Skaria


"jfp" wrote:

=IF(ISERROR(MATCH(9.999999E+306,A:A)),MATCH("*",A: A,-1),
IF(ISERROR(MATCH("*",A:A,-1)),MATCH(9.999999E+306,A:A),
MAX(MATCH(9.999999E+306,A:A),MATCH("*",A:A,-1))))

I have the above function which allows me to select the final data I have
inputted. What do I need to add in order to get the last but one piece of
data? Is this possible?

I create tables which have todays price, last weeks price and the price from
the corresponding week last year too (so having the option for 52 cells above
the last one would also be useful). These prices are all listed in a table
which I then need to summarise - hence the request.

Many thanks

James

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
Penultimate cell Antonio Excel Discussion (Misc queries) 8 February 10th 08 12:46 PM
Selecting data that matches certain criteria in one column Anthony Excel Discussion (Misc queries) 7 May 17th 07 12:48 PM
Selecting data from a column RON Excel Worksheet Functions 3 March 7th 07 02:05 AM
Selecting A Column based on Cell Value newguy Excel Discussion (Misc queries) 0 December 14th 06 09:39 PM
Selecting any cell in a column I want my ComboBox to show. How? ABP MLundqvist Excel Discussion (Misc queries) 4 March 1st 06 01:15 PM


All times are GMT +1. The time now is 12:25 AM.

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"