Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default List last 5 non-zero entries

I am trying to setup a graph that will show the last five values from a range
in Excel.

The range is setup so that there could be gaps in the list:

Week 1 20000
Week 2
Week 3 19000
Week 4 21000
..... .....

I setup a table to put the last 5 values in but I need to know how to
exclude blanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default List last 5 non-zero entries

If the data is in A1:A15 (change range to suit), try

=INDEX($A$1:$A$15,LARGE(($A$1:$A$15<"")*(ROW($A$1 :$A$15)-ROW($A$1)+1),5))

Change the 5 at the end to 4,3,2,1 to get the rest of the numbers you need.
It is an array formula and needs to be entered w/Cntrl+Shift+Enter.


"Rayo K" wrote:

I am trying to setup a graph that will show the last five values from a range
in Excel.

The range is setup so that there could be gaps in the list:

Week 1 20000
Week 2
Week 3 19000
Week 4 21000
.... .....

I setup a table to put the last 5 values in but I need to know how to
exclude blanks

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default List last 5 non-zero entries

Let's say your data in A1:A100

In B1:
=INDEX($A$1:$A$100,LARGE(IF(($A$1:$A$100<"")*(ROW ($A$1:$A$100)),ROW(INDIRECT("1:"&ROWS($A$1:$A$100) ))),ROWS($1:1)))

ctrl+shift+enter, not just enter
Drag the Fill Handle to copy from B1 to B5


"Rayo K" wrote:

I am trying to setup a graph that will show the last five values from a range
in Excel.

The range is setup so that there could be gaps in the list:

Week 1 20000
Week 2
Week 3 19000
Week 4 21000
.... .....

I setup a table to put the last 5 values in but I need to know how to
exclude blanks

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default List last 5 non-zero entries

I notice you said non-zero, not non-blank. I think <0 will eliminate cells
that are either 0 or empty (but not cells that contain an empty string - "").

=INDEX($A$1:$A$15,LARGE(($A$1:$A$15<0)*(ROW($A$1: $A$15)-ROW($A$1)+1),5))

or to eliminate 0, empty cells, and empty strings, this appears to work:

=INDEX($A$1:$A$15,LARGE(($A$1:$A$15<0)*($A$1:$A$1 5<"")*(ROW($A$1:$A$15)-ROW($A$1)+1),5))



"JMB" wrote:

If the data is in A1:A15 (change range to suit), try

=INDEX($A$1:$A$15,LARGE(($A$1:$A$15<"")*(ROW($A$1 :$A$15)-ROW($A$1)+1),5))

Change the 5 at the end to 4,3,2,1 to get the rest of the numbers you need.
It is an array formula and needs to be entered w/Cntrl+Shift+Enter.


"Rayo K" wrote:

I am trying to setup a graph that will show the last five values from a range
in Excel.

The range is setup so that there could be gaps in the list:

Week 1 20000
Week 2
Week 3 19000
Week 4 21000
.... .....

I setup a table to put the last 5 values in but I need to know how to
exclude blanks

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
Namebox entries in a list box Greshter Excel Discussion (Misc queries) 1 January 5th 07 04:00 AM
Removing all entries in one list that appear in a different list WLarson Excel Discussion (Misc queries) 1 May 12th 06 02:39 AM
Matching List Entries steev_jd Excel Discussion (Misc queries) 3 April 6th 06 03:11 PM
List only red entries Carol Excel Worksheet Functions 1 July 29th 05 02:22 PM
MRU list - entries keep changing Ellen Excel Discussion (Misc queries) 2 June 20th 05 09:19 PM


All times are GMT +1. The time now is 05:19 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"