![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: Phoenix, AZ, USA
Posts: 29
|
I am looking for a formula-based solution so I can put this into a larger formula. Here is a sample:
Code:
ColA Row1 0 Row2 3 Row3 4 Row4 0 Row5 1 Thanks! [ This Message was edited by: PHMayfield on 2002-05-17 10:57 ] |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
=MATCH(MIN(IF(A1:A5,A1:A5)),A1:A5,0) To array-enter a formula, you need to hit control+hift+enter at the same time, not just enter. This will give the "index" of the first instance of the non-zero min value. Aladin |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,028
|
Hey,
Based on your example, how about: =MATCH(SMALL(A1:A5,1+COUNTIF(A1:A5,0)),A1:A5,0) You may have to tweak the formula a bit if your data does not start on row1. If your data started on row 6, for example, you'd want to add 5 at the end of the formula to get the correct row number. Hope that helps, Adam |
|
|
|
|
|
#4 |
|
New Member
Join Date: Apr 2002
Location: Phoenix, AZ, USA
Posts: 29
|
Thanks, that worked great.
I should say, both work fine. [ This Message was edited by: PHMayfield on 2002-05-17 11:19 ] |
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
The following array formula will also work:
=MATCH(SMALL(A1:A5,SUM(IF(A1:A5=0,0,1))),A1:A5,0) Regards! |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|