Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default locate first value greater than

I would like to be able to return the first column that has a number greater
than zero. For instance

3/2 3/9 3/16 3/23 3/30
Product A 0 0 12 0 20

How could I get a result that either returned 3/16 as the first date or
column 4 as the first instance?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default locate first value greater than

=MIN(IF(B2:F20,COLUMN(B2:F2),FALSE))
Input this as an array (Use Ctrl+Shift+Enter). If done right, you should see
curly brackets {} appear around your formula.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"MPI Planner" wrote:

I would like to be able to return the first column that has a number greater
than zero. For instance

3/2 3/9 3/16 3/23 3/30
Product A 0 0 12 0 20

How could I get a result that either returned 3/16 as the first date or
column 4 as the first instance?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 73
Default locate first value greater than

Another one:

=INDEX(B1:F1,MATCH(TRUE,INDEX(B2:F20,0),0))

Format as Date

--
Biff
Microsoft Excel MVP


"MPI Planner" wrote:

I would like to be able to return the first column that has a number greater
than zero. For instance

3/2 3/9 3/16 3/23 3/30
Product A 0 0 12 0 20

How could I get a result that either returned 3/16 as the first date or
column 4 as the first instance?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,104
Default locate first value greater than

The UDF called with, fro example, =Tryme(B2:Q2) will return 3/16
best wishes

Function tryme(myrange)
mylast = myrange.Count
tryme = "No non-zero"
For Each mycell In myrange
If mycell.Value < 0 Then
tryme = mycell.Offset(-1, 0)
Exit For
End If
Next
End Function

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"MPI Planner" wrote in message
...
I would like to be able to return the first column that has a number
greater
than zero. For instance

3/2 3/9 3/16 3/23 3/30
Product A 0 0 12 0 20

How could I get a result that either returned 3/16 as the first date or
column 4 as the first instance?



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default locate first value greater than

On Fri, 27 Feb 2009 07:56:03 -0800, MPI Planner
wrote:

I would like to be able to return the first column that has a number greater
than zero. For instance

3/2 3/9 3/16 3/23 3/30
Product A 0 0 12 0 20

How could I get a result that either returned 3/16 as the first date or
column 4 as the first instance?



With dates in row 1, and data in row 2:

=MATCH(1,INDEX(ISNUMBER(2:2)*(2:20),0),0) -- 4

=INDEX(1:1,,MATCH(1,INDEX(ISNUMBER(2:2)*(2:20),0) ,0)) -- 3/16


--ron


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default locate first value greater than

Hi,

Try this array formula (Ctrl+Shift+Enter)

=INDEX(C7:H8,1,MATCH(TRUE,D8:H80,0)+1)

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"MPI Planner" wrote in message
...
I would like to be able to return the first column that has a number
greater
than zero. For instance

3/2 3/9 3/16 3/23 3/30
Product A 0 0 12 0 20

How could I get a result that either returned 3/16 as the first date or
column 4 as the first instance?


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default locate first value greater than

This worked great. How can I add a lookup to this? I would like to be able to
reference a cell and find that value in the table to return the same data.

vlookup(z1,a1:y1000,INDEX(B1:F1,MATCH(TRUE,INDEX(B 2:F20,0),0)))?

"T. Valko" wrote:

Another one:

=INDEX(B1:F1,MATCH(TRUE,INDEX(B2:F20,0),0))

Format as Date

--
Biff
Microsoft Excel MVP


"MPI Planner" wrote:

I would like to be able to return the first column that has a number greater
than zero. For instance

3/2 3/9 3/16 3/23 3/30
Product A 0 0 12 0 20

How could I get a result that either returned 3/16 as the first date or
column 4 as the first instance?

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
STILL CAN'T LOCATE XML emi New Users to Excel 1 July 24th 07 11:04 PM
Locate Duplicates Gary Excel Worksheet Functions 3 December 29th 06 10:48 PM
Locate Workbook Kev Excel Discussion (Misc queries) 2 December 28th 06 04:07 PM
Cannot locate icons ?? Koko New Users to Excel 3 August 3rd 05 08:52 AM
How can I locate the second to last value in a range? A shink Excel Worksheet Functions 5 June 4th 05 01:17 AM


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