Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default First Positive on Horizontal Array

Is there a function that results/looks for the first single positive (non
zero) value in a Horizontal Array?
For example:
A B C D E F
Row 1: 0 2 5 1 0 2
Return the value that will be the first positive in the array, which will be
"2".

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default First Positive on Horizontal Array

One way:

=INDEX(1:1,MATCH(TRUE,1:10,0))
or
=INDEX(a1:x1,MATCH(TRUE,a1:x10,0))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

VCUE wrote:

Is there a function that results/looks for the first single positive (non
zero) value in a Horizontal Array?
For example:
A B C D E F
Row 1: 0 2 5 1 0 2
Return the value that will be the first positive in the array, which will be
"2".


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default First Positive on Horizontal Array

Try this array formula** :

Assuming the range will only contain numbers.

=IF(COUNTIF(A1:F1,"0"),INDEX(A1:F1,MATCH(TRUE,A1: F10,0)),"")

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"VCUE" wrote in message
...
Is there a function that results/looks for the first single positive (non
zero) value in a Horizontal Array?
For example:
A B C D E F
Row 1: 0 2 5 1 0 2
Return the value that will be the first positive in the array, which will
be
"2".



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default First Positive on Horizontal Array

Your formula returns 4 instead of 2

=INDEX(1:1,MATCH(TRUE,1:10,0))


ex. a1=4 (text value), b1=2, c1=5, d1=1, e1=0, f1=2



"Dave Peterson" wrote:

One way:

=INDEX(1:1,MATCH(TRUE,1:10,0))
or
=INDEX(a1:x1,MATCH(TRUE,a1:x10,0))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

VCUE wrote:

Is there a function that results/looks for the first single positive (non
zero) value in a Horizontal Array?
For example:
A B C D E F
Row 1: 0 2 5 1 0 2
Return the value that will be the first positive in the array, which will be
"2".


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default First Positive on Horizontal Array

Your formula returns 4 instead of 2

=IF(COUNTIF(A1:F1,"0"),INDEX(A1:F1,MATCH(TRUE,A1: F10,0)),"")


ex. a1=4 (text value), b1=2, c1=5, d1=1, e1=0, f1=2


"T. Valko" wrote:

Try this array formula** :

Assuming the range will only contain numbers.

=IF(COUNTIF(A1:F1,"0"),INDEX(A1:F1,MATCH(TRUE,A1: F10,0)),"")

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"VCUE" wrote in message
...
Is there a function that results/looks for the first single positive (non
zero) value in a Horizontal Array?
For example:
A B C D E F
Row 1: 0 2 5 1 0 2
Return the value that will be the first positive in the array, which will
be
"2".






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default First Positive on Horizontal Array

=INDEX(1:1,MATCH(1,(1:10)*ISNUMBER(1:1),0))

Still an array formula.

Teethless mama wrote:

Your formula returns 4 instead of 2

=INDEX(1:1,MATCH(TRUE,1:10,0))


ex. a1=4 (text value), b1=2, c1=5, d1=1, e1=0, f1=2

"Dave Peterson" wrote:

One way:

=INDEX(1:1,MATCH(TRUE,1:10,0))
or
=INDEX(a1:x1,MATCH(TRUE,a1:x10,0))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

VCUE wrote:

Is there a function that results/looks for the first single positive (non
zero) value in a Horizontal Array?
For example:
A B C D E F
Row 1: 0 2 5 1 0 2
Return the value that will be the first positive in the array, which will be
"2".


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default First Positive on Horizontal Array

I think this array-entered** formula will do what you asked...

=INDEX(A1:F1,1,MIN(IF(A1:F1=0,99999,COLUMN(A1:F1)) ))

** Commit this formula using Ctrl+Shift+Enter (not just Enter).

Rick


"VCUE" wrote in message
...
Is there a function that results/looks for the first single positive (non
zero) value in a Horizontal Array?
For example:
A B C D E F
Row 1: 0 2 5 1 0 2
Return the value that will be the first positive in the array, which will
be
"2".


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default First Positive on Horizontal Array

Your formula returns 4 instead of 2
ex. a1=4 (text value), b1=2, c1=5, d1=1, e1=0, f1=2


Apparently you missed this:

Assuming the range will only contain numbers.



--
Biff
Microsoft Excel MVP


"Teethless mama" wrote in message
...
Your formula returns 4 instead of 2

=IF(COUNTIF(A1:F1,"0"),INDEX(A1:F1,MATCH(TRUE,A1: F10,0)),"")


ex. a1=4 (text value), b1=2, c1=5, d1=1, e1=0, f1=2


"T. Valko" wrote:

Try this array formula** :

Assuming the range will only contain numbers.

=IF(COUNTIF(A1:F1,"0"),INDEX(A1:F1,MATCH(TRUE,A1: F10,0)),"")

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"VCUE" wrote in message
...
Is there a function that results/looks for the first single positive
(non
zero) value in a Horizontal Array?
For example:
A B C D E F
Row 1: 0 2 5 1 0 2
Return the value that will be the first positive in the array, which
will
be
"2".






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
First Positive in Horizontal Array VCUE Excel Discussion (Misc queries) 2 July 9th 08 06:21 PM
Horizontal array Wanna Learn Excel Discussion (Misc queries) 2 February 1st 07 02:03 PM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
How do I paste horizontal references in large array Dave Kaleel Excel Worksheet Functions 0 February 6th 06 03:51 PM
Formula to make Negative Values Positive & Positive Values Negative? mustard Excel Discussion (Misc queries) 4 September 26th 05 10:05 PM


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