Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Carolyn Bennett
 
Posts: n/a
Default FIND THE LAST CELL ENTRY IN A ROW

I am creating a document where I want excel to seach along a row and find the
last entry (the cell with information on the far right of the row). This
information will change constantly, and I will need excel to keep check for
new entries to the right of it.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default FIND THE LAST CELL ENTRY IN A ROW

Hi!

Take your pick:

If the data is numeric:

=LOOKUP(MAX(A1:Z1)+1,A1:Z1)

If the data is text:

=LOOKUP(REPT("z",255),A1:Z1)

If the data is mixed:

=LOOKUP(2,1/(A1:Z1<""),A1:Z1)

Biff

"Carolyn Bennett" <Carolyn wrote in
message ...
I am creating a document where I want excel to seach along a row and find
the
last entry (the cell with information on the far right of the row). This
information will change constantly, and I will need excel to keep check
for
new entries to the right of it.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Carolyn Bennett
 
Posts: n/a
Default FIND THE LAST CELL ENTRY IN A ROW

Biff,

That was exactly what I wanted, thank you so much! I have no idea how it
worked, but it worked.
I don't suppose you would now know how to now that I have worked out what
the last entry in the in the row is, how I can tell it to reference the cell
two cells vertically above it?

"Biff" wrote:

Hi!

Take your pick:

If the data is numeric:

=LOOKUP(MAX(A1:Z1)+1,A1:Z1)

If the data is text:

=LOOKUP(REPT("z",255),A1:Z1)

If the data is mixed:

=LOOKUP(2,1/(A1:Z1<""),A1:Z1)

Biff

"Carolyn Bennett" <Carolyn wrote in
message ...
I am creating a document where I want excel to seach along a row and find
the
last entry (the cell with information on the far right of the row). This
information will change constantly, and I will need excel to keep check
for
new entries to the right of it.




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default FIND THE LAST CELL ENTRY IN A ROW

It all depends!

It could be as easy as:

=OFFSET(B4,-2,MATCH(A1,B4:IV4,0)-1)

Whe

A1 = result of your lookup formula
Row 4 is the row that the lookup formula was used on
B4 is the first cell in row 4 that begins the data range

More detail would be helpful!

Biff

"Carolyn Bennett" wrote in
message ...
Biff,

That was exactly what I wanted, thank you so much! I have no idea how it
worked, but it worked.
I don't suppose you would now know how to now that I have worked out what
the last entry in the in the row is, how I can tell it to reference the
cell
two cells vertically above it?

"Biff" wrote:

Hi!

Take your pick:

If the data is numeric:

=LOOKUP(MAX(A1:Z1)+1,A1:Z1)

If the data is text:

=LOOKUP(REPT("z",255),A1:Z1)

If the data is mixed:

=LOOKUP(2,1/(A1:Z1<""),A1:Z1)

Biff

"Carolyn Bennett" <Carolyn wrote in
message ...
I am creating a document where I want excel to seach along a row and
find
the
last entry (the cell with information on the far right of the row).
This
information will change constantly, and I will need excel to keep check
for
new entries to the right of it.






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Aladin Akyurek
 
Posts: n/a
Default FIND THE LAST CELL ENTRY IN A ROW

Lets suppose that you want the last numeric entry from row 3...

=LOOKUP(9.99999999999999E+307,3:3)

would yield that entry if row 3 is not empty.

If you replace LOOKUP with MATCH in the above formula, you will get the
position of the last numeric entry.

If you want the value from row 1 which is associated with the last
numeric entry in row 3...

=LOOKUP(9.99999999999999E+307,3:3,1:1)

Put up in terms of exact ranges, e.e.,:

=LOOKUP(9.99999999999999E+307,C3:Z3)

=MATCH(9.99999999999999E+307,C3:Z3)

=LOOKUP(9.99999999999999E+307,C3:Z3,C1:Z1)

Carolyn Bennett wrote:
[...]
I don't suppose you would now know how to now that I have worked out what
the last entry in the in the row is, how I can tell it to reference the cell
two cells vertically above it?

[...]


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default FIND THE LAST CELL ENTRY IN A ROW

"Biff" wrote...
Take your pick:

If the data is numeric:

=LOOKUP(MAX(A1:Z1)+1,A1:Z1)

....

Why go through the range twice? Also, if there were any errors in the range,
the MAX call and thus the LOOKUP call would propagate the first error
encountered. Use .999999999999999E308 rather than the MAX call to be sure to
return the last numeric value if there are any.

If the data is mixed:

=LOOKUP(2,1/(A1:Z1<""),A1:Z1)


Begging the question what to do if the last nonblank (strict sense) cell
evaluates to "". An alternative,

=LOOKUP(2,1/(1-ISBLANK(A1:Z1)),A1:Z1)

Actually, light testing shows that the following work.

=LOOKUP(TRUE,ISNUMBER(A1:Z1),A1:Z1)

=LOOKUP(TRUE,ISTEXT(A1:Z1),A1:Z1)

=LOOKUP(TRUE,NOT(ISBLANK(A1:Z1)),A1:Z1)


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default FIND THE LAST CELL ENTRY IN A ROW

====================
=LOOKUP(MAX(A1:Z1)+1,A1:Z1)


Why go through the range twice? Also, if there were any errors in the range,
the MAX call and thus the LOOKUP call would propagate the first error
encountered. Use .999999999999999E308 rather than the MAX call to be sure to
return the last numeric value if there are any.
====================

It's just a personal preference. It's easier than trying to count the number
of 9s when typing .999999999999999E308 or 9.99999999999999E+307. There's no
doubt it's more efficient but I also believe that the vast majority of
spreadsheets are not so robust that efficiency is a primary concern. At the
most, that formula only goes through a full row. That is a good point about
the possibility of errors, though.

Biff

"Harlan Grove" wrote in message
...
"Biff" wrote...
Take your pick:

If the data is numeric:

=LOOKUP(MAX(A1:Z1)+1,A1:Z1)

...

Why go through the range twice? Also, if there were any errors in the
range, the MAX call and thus the LOOKUP call would propagate the first
error encountered. Use .999999999999999E308 rather than the MAX call to be
sure to return the last numeric value if there are any.

If the data is mixed:

=LOOKUP(2,1/(A1:Z1<""),A1:Z1)


Begging the question what to do if the last nonblank (strict sense) cell
evaluates to "". An alternative,

=LOOKUP(2,1/(1-ISBLANK(A1:Z1)),A1:Z1)

Actually, light testing shows that the following work.

=LOOKUP(TRUE,ISNUMBER(A1:Z1),A1:Z1)

=LOOKUP(TRUE,ISTEXT(A1:Z1),A1:Z1)

=LOOKUP(TRUE,NOT(ISBLANK(A1:Z1)),A1:Z1)



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default FIND THE LAST CELL ENTRY IN A ROW

I'm curious as to how you and Aladin would handle this scenario:

You have a spreadsheet that you keep for your bowling league. The bowlers
scores are recorded and one of the formulas you use is to lookup the last
score posted in row 2. Assume the cells for the scores have data validation
applied so that only TRUE bowling scores can be entered.

Which formula would you use (if either) and why?

=LOOKUP(9.99999999999999E+307,2:2)

=LOOKUP(301,2:2)

I would use the 2nd.

Biff

"Harlan Grove" wrote in message
...
"Biff" wrote...
Take your pick:

If the data is numeric:

=LOOKUP(MAX(A1:Z1)+1,A1:Z1)

...

Why go through the range twice? Also, if there were any errors in the
range, the MAX call and thus the LOOKUP call would propagate the first
error encountered. Use .999999999999999E308 rather than the MAX call to be
sure to return the last numeric value if there are any.

If the data is mixed:

=LOOKUP(2,1/(A1:Z1<""),A1:Z1)


Begging the question what to do if the last nonblank (strict sense) cell
evaluates to "". An alternative,

=LOOKUP(2,1/(1-ISBLANK(A1:Z1)),A1:Z1)

Actually, light testing shows that the following work.

=LOOKUP(TRUE,ISNUMBER(A1:Z1),A1:Z1)

=LOOKUP(TRUE,ISTEXT(A1:Z1),A1:Z1)

=LOOKUP(TRUE,NOT(ISBLANK(A1:Z1)),A1:Z1)



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
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
find a cells from a range of cell kelvintaycc Excel Worksheet Functions 2 April 2nd 05 07:20 PM
resolving a numeric cell entry for its meaning vtcrob Excel Worksheet Functions 0 February 4th 05 02:23 AM
Move the last entry in a column to a different cell, when the loc. MicroSoft Excell (?) Excel Worksheet Functions 2 January 7th 05 09:29 PM
how do i set up a single cell continual entry in excel to total f. mike@swallow Excel Discussion (Misc queries) 1 December 7th 04 12:29 PM


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