#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Code problem

Hi, i have this code:
=IF(COUNT(U8:X8),IF(TODAY()=MAX(U8:X8),"Expired", INDEX(U8:X8,,MIN(IF(U8:X8TODAY(),COLUMN(U8:X8))))-TODAY()),"")
This code it's working only in A1:D1 range, but in U8:X8 range gives me
#REF! error.
Can this be fixed?
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Code problem

Try this array formula which should work on any range.

=IF(COUNT(U8:X8),IF(TODAY()=MAX(U8:X8),"Expired", INDEX(U8:X8,,MIN(IF(U8:X8TODAY(),COLUMN(U8:X8)))-COLUMN(U8:X8)+1)-TODAY()),"")

PS: The reason is that COLUMN() returns the column number which is in the
range of 20+ where as the formula uses INDEX() which has got only 4 columns

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


"puiuluipui" wrote:

Hi, i have this code:
=IF(COUNT(U8:X8),IF(TODAY()=MAX(U8:X8),"Expired", INDEX(U8:X8,,MIN(IF(U8:X8TODAY(),COLUMN(U8:X8))))-TODAY()),"")
This code it's working only in A1:D1 range, but in U8:X8 range gives me
#REF! error.
Can this be fixed?
Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Code problem

Beautifull!!
Thanks!

"Jacob Skaria" a scris:

Try this array formula which should work on any range.

=IF(COUNT(U8:X8),IF(TODAY()=MAX(U8:X8),"Expired", INDEX(U8:X8,,MIN(IF(U8:X8TODAY(),COLUMN(U8:X8)))-COLUMN(U8:X8)+1)-TODAY()),"")

PS: The reason is that COLUMN() returns the column number which is in the
range of 20+ where as the formula uses INDEX() which has got only 4 columns

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


"puiuluipui" wrote:

Hi, i have this code:
=IF(COUNT(U8:X8),IF(TODAY()=MAX(U8:X8),"Expired", INDEX(U8:X8,,MIN(IF(U8:X8TODAY(),COLUMN(U8:X8))))-TODAY()),"")
This code it's working only in A1:D1 range, but in U8:X8 range gives me
#REF! error.
Can this be fixed?
Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 913
Default Code problem

On Fri, 3 Jul 2009 03:36:01 -0700, puiuluipui
wrote:


Hi, i have this code:
=IF(COUNT(U8:X8),IF(TODAY()=MAX(U8:X8),"Expired" ,INDEX(U8:X8,,MIN(IF(U8:X8TODAY(),COLUMN(U8:X8))) )-TODAY()),"")
This code it's working only in A1:D1 range, but in U8:X8 range gives me
#REF! error.
Can this be fixed?
Thanks!



Try this:

=IF(COUNT(U8:X8),IF(TODAY()=MAX(U8:X8),"Expired", INDEX(U8:X8,,MIN(IF(U8:X8TODAY(),COLUMN(U8:X8)-COLUMN(U8)+1)))-TODAY()),"")

Hope this helps / Lars-Åke
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
Problem with code kk Excel Discussion (Misc queries) 0 March 15th 08 03:01 PM
CODE PROBLEM N.F[_2_] Excel Discussion (Misc queries) 2 June 15th 07 08:07 PM
VB Code Problem Stan Excel Discussion (Misc queries) 6 April 25th 07 01:48 AM
XLS to CSV Code Problem carl Excel Worksheet Functions 0 March 28th 07 01:21 AM
Little problem with this code... simonsmith Excel Discussion (Misc queries) 11 May 21st 06 04:02 AM


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