Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Max Date With Information In Adjacent Field

I am trying to create a weight loss spreadsheet. Column B has dates in
ascending order, and column c has current day's weight. I want to display
the weight corresponding with the max date that has a weight value greater
than zero.

As weight values are entered, I want the field to automatically update.

On Feb 1, the 192 should show. On Feb 2, the 191 should show. On Feb 3,
the 190 should show. On Feb 4, whatever the user inserts should show.

Spreadsheet Looks like this:

Column B Column C
02/01/2008 192
02/02/2008 191
02/03/2008 190
02/04/2008 <blank value
02/05/2008 <blank value
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Max Date With Information In Adjacent Field

Try this in the cell where you want the last weight entered to show up:
=INDEX(C:C,MATCH(2000,C:C,1))
The 2000 is the max value to lookup, I figure 2000 probably exceeds any
living human's weight.
Someone may come up with a better solution, but I think this one will work
for you.

When no weights have been entered, it will show #N/A. You can get around
that with this:
=IF(ISNA(INDEX(C:C,MATCH(1000,C:C,1))),"",INDEX(C: C,MATCH(1000,C:C,1)))

"Paperback Writer" wrote:

I am trying to create a weight loss spreadsheet. Column B has dates in
ascending order, and column c has current day's weight. I want to display
the weight corresponding with the max date that has a weight value greater
than zero.

As weight values are entered, I want the field to automatically update.

On Feb 1, the 192 should show. On Feb 2, the 191 should show. On Feb 3,
the 190 should show. On Feb 4, whatever the user inserts should show.

Spreadsheet Looks like this:

Column B Column C
02/01/2008 192
02/02/2008 191
02/03/2008 190
02/04/2008 <blank value
02/05/2008 <blank value

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Max Date With Information In Adjacent Field

Another one:

=IF(COUNT(C:C),LOOKUP(1E100,C:C),"")

--
Biff
Microsoft Excel MVP


"Paperback Writer" wrote in
message ...
I am trying to create a weight loss spreadsheet. Column B has dates in
ascending order, and column c has current day's weight. I want to display
the weight corresponding with the max date that has a weight value greater
than zero.

As weight values are entered, I want the field to automatically update.

On Feb 1, the 192 should show. On Feb 2, the 191 should show. On Feb 3,
the 190 should show. On Feb 4, whatever the user inserts should show.

Spreadsheet Looks like this:

Column B Column C
02/01/2008 192
02/02/2008 191
02/03/2008 190
02/04/2008 <blank value
02/05/2008 <blank value



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Max Date With Information In Adjacent Field

These work!

BUT! Now, I need a very similar solution. Let's say that Column C has
zeroes in it. How to return the last value that isn't a zero? In the
example below, it will show 190. The solutions posted thus far would all
show 0. -- Thanks!!!!

Column B Column C
02/01/2008 192
02/02/2008 191
02/03/2008 190
02/04/2008 0
02/05/2008 0
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Max Date With Information In Adjacent Field

Assuming that column C contains *only* numbers:

=IF(COUNTIF(C:C,"0"),LOOKUP(2,1/(C2:C200),C2:C20),"")


--
Biff
Microsoft Excel MVP


"Paperback Writer" wrote in
message ...
These work!

BUT! Now, I need a very similar solution. Let's say that Column C has
zeroes in it. How to return the last value that isn't a zero? In the
example below, it will show 190. The solutions posted thus far would all
show 0. -- Thanks!!!!

Column B Column C
02/01/2008 192
02/02/2008 191
02/03/2008 190
02/04/2008 0
02/05/2008 0



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
New date based on one date field minus minutes in another field [email protected] Excel Discussion (Misc queries) 1 December 25th 07 04:05 PM
Data Validation to restrict blank value in adjacent field John S. Labarge Excel Discussion (Misc queries) 5 August 17th 07 09:33 PM
Linked date field in worksheet defaults a blank field as 1/0/1900 AmnNkD Excel Worksheet Functions 2 September 12th 06 05:42 PM
How to Join/concatenate a date field with a time field in Excel? Alan Excel Discussion (Misc queries) 4 August 9th 05 10:07 PM
Calculate month-end date from date in adjacent cell? Matt D Francis Excel Worksheet Functions 4 May 19th 05 04:55 AM


All times are GMT +1. The time now is 12:20 PM.

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"