Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
sd
 
Posts: n/a
Default formula to determine the first column containing any data

I have columns of data starting from Jan 2002 thru Sep 04 (33 columns)
Data contains numbers or are blank
Is there any formula (other than a VBA) that can determine against each row
the last month I had any number
Example:-

Jan-00 feb-00 mar-00 apr-00 may-00
50 12

The result should be Feb-00 as that month is the last time when I had a
data (and not blank) looking from right to left.
Just the formula to determine the column # will suffice, using offset I can
determine the month.


  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

sd,

=SUMPRODUCT(MAX((2:2<"")*(COLUMN(2:2))))

so,

=INDEX($1:$1,SUMPRODUCT(MAX((2:2<"")*(COLUMN(2:2) ))))

HTH,
Bernie
MS Excel MVP

"sd" wrote in message
...
I have columns of data starting from Jan 2002 thru Sep 04 (33 columns)
Data contains numbers or are blank
Is there any formula (other than a VBA) that can determine against each

row
the last month I had any number
Example:-

Jan-00 feb-00 mar-00 apr-00 may-00
50 12

The result should be Feb-00 as that month is the last time when I had a
data (and not blank) looking from right to left.
Just the formula to determine the column # will suffice, using offset I

can
determine the month.




  #3   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
as alternative:
=LOOKUP(2,1/(1:1<""),1:1)

Also see http://www.xldynamic.com/source/xld.LastValue.html

--
Regards
Frank Kabel
Frankfurt, Germany

"sd" schrieb im Newsbeitrag
...
I have columns of data starting from Jan 2002 thru Sep 04 (33

columns)
Data contains numbers or are blank
Is there any formula (other than a VBA) that can determine against

each row
the last month I had any number
Example:-

Jan-00 feb-00 mar-00 apr-00 may-00
50 12

The result should be Feb-00 as that month is the last time when I

had a
data (and not blank) looking from right to left.
Just the formula to determine the column # will suffice, using offset

I can
determine the month.



  #4   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Cool formula, Frank. The OP would need it to be

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

Bernie
MS Excel MVP

"Frank Kabel" wrote in message
...
Hi
as alternative:
=LOOKUP(2,1/(1:1<""),1:1)

Also see http://www.xldynamic.com/source/xld.LastValue.html

--
Regards
Frank Kabel
Frankfurt, Germany

"sd" schrieb im Newsbeitrag
...
I have columns of data starting from Jan 2002 thru Sep 04 (33

columns)
Data contains numbers or are blank
Is there any formula (other than a VBA) that can determine against

each row
the last month I had any number
Example:-

Jan-00 feb-00 mar-00 apr-00 may-00
50 12

The result should be Feb-00 as that month is the last time when I

had a
data (and not blank) looking from right to left.
Just the formula to determine the column # will suffice, using offset

I can
determine the month.





  #5   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi Bernie
correct. Good spot.
Thanks for this formula though should go to Aladin (at least I think he
was the first one who posted this LOOKUP formula type)

Note: This formula is also quite slow. So if The OP only has numeric
values to look for he may also try:
=LOOKUP(9.999999E307,2:2,1:1)

--
Regards
Frank Kabel
Frankfurt, Germany

"Bernie Deitrick" <deitbe @ consumer dot org schrieb im Newsbeitrag
...
Cool formula, Frank. The OP would need it to be

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

Bernie
MS Excel MVP

"Frank Kabel" wrote in message
...
Hi
as alternative:
=LOOKUP(2,1/(1:1<""),1:1)

Also see http://www.xldynamic.com/source/xld.LastValue.html

--
Regards
Frank Kabel
Frankfurt, Germany

"sd" schrieb im Newsbeitrag
...
I have columns of data starting from Jan 2002 thru Sep 04 (33

columns)
Data contains numbers or are blank
Is there any formula (other than a VBA) that can determine

against
each row
the last month I had any number
Example:-

Jan-00 feb-00 mar-00 apr-00 may-00
50 12

The result should be Feb-00 as that month is the last time when

I
had a
data (and not blank) looking from right to left.
Just the formula to determine the column # will suffice, using

offset
I can
determine the month.








  #6   Report Post  
Aladin Akyurek
 
Posts: n/a
Default


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

where 2:2 houses the numeric data of interest and 1:1 true dates.

sd Wrote:
I have columns of data starting from Jan 2002 thru Sep 04 (33 columns)
Data contains numbers or are blank
Is there any formula (other than a VBA) that can determine against each
row
the last month I had any number
Example:-

Jan-00 feb-00 mar-00 apr-00 may-00
50 12

The result should be Feb-00 as that month is the last time when I had
a
data (and not blank) looking from right to left.
Just the formula to determine the column # will suffice, using offset I
can
determine the month.



--
Aladin Akyurek
------------------------------------------------------------------------
Aladin Akyurek's Profile: http://www.excelforum.com/member.php...fo&userid=4165
View this thread: http://www.excelforum.com/showthread...hreadid=276594

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
Insert rows based on specific value bob Excel Worksheet Functions 6 February 29th 08 07:11 PM
how do I make a formula NOT change when the data range is moved? Alida Andrews Excel Discussion (Misc queries) 2 January 6th 05 09:02 PM
Aligning Two Lists in Excel Rich Excel Discussion (Misc queries) 2 December 4th 04 05:44 PM
Excel2K: Is it possible to use dynamic named ranges in custom data validation formula? Arvi Laanemets Excel Discussion (Misc queries) 0 December 2nd 04 11:29 AM
Formula to Extract Data from a Table Macshots Excel Worksheet Functions 2 November 5th 04 06:35 AM


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