Find First Negative Number after 'X' has been reached

dwg1803

New Member
Joined
Sep 5, 2014
Messages
4
Hello All, i am in a pinch.

I have read several threads and the content looks great. I just haven't found a solution for my challenge yet.

Here it is, any insight would be greatly appreciated.

my screen shot: 2014-09-05_1302 - willgrimmer's library

I have 8 cells in columns A-H in Row 3. their contents are

-5, 5, -2, 4, -2, 10, 4, 11

in Cell K1 = 3

I need a formula that will tell me which position in Row 3; where after the value in K1 has been exceeded, I need the position of the next time i have a value of less than or equal to "Zero". Looking at the data, the answer should be "3", but I am having a hard time using "Match" and "Index" and "ISNA" formulas that are not working.

Any insight would be Greatly Appreciated.

thanks in advance.


Will
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

oldbrewer

Well-known Member
Joined
Apr 11, 2010
Messages
11,005
3 is exceeded by the second number (5)

you want the next time a number is <1 after the 5 ie -2 the third number = 3 is this correct?
 
Upvote 0

dwg1803

New Member
Joined
Sep 5, 2014
Messages
4
Hi Oldbrewer,

yes, that is exactly what i am looking for. I'm glad you were able to decipher my explanation.


thanks.


Will
 
Upvote 0

dwg1803

New Member
Joined
Sep 5, 2014
Messages
4
Hi Oldbrewer, any ideas? I've been looking around online and haven't found any solutions yet.


thanks.


Will
 
Upvote 0

oldbrewer

Well-known Member
Joined
Apr 11, 2010
Messages
11,005
I am thinking around using offset match to find your chosen number in one row and in the row below offset match that only triggers if chosen number detected in row above UK here beer time if u still need it tomorrow I will think on...
 
Upvote 0

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
Hello All, i am in a pinch.

I have read several threads and the content looks great. I just haven't found a solution for my challenge yet.

Here it is, any insight would be greatly appreciated.

my screen shot: 2014-09-05_1302 - willgrimmer's library

I have 8 cells in columns A-H in Row 3. their contents are

-5, 5, -2, 4, -2, 10, 4, 11

in Cell K1 = 3

I need a formula that will tell me which position in Row 3; where after the value in K1 has been exceeded, I need the position of the next time i have a value of less than or equal to "Zero". Looking at the data, the answer should be "3", but I am having a hard time using "Match" and "Index" and "ISNA" formulas that are not working.

Any insight would be Greatly Appreciated.

thanks in advance.


Will

Row 3, K1 =3 , result is "3". Such makes things hard to follow...

Care to stipulate how "3" obtains?
 
Upvote 0

oldbrewer

Well-known Member
Joined
Apr 11, 2010
Messages
11,005
-5, 5, -2, 4, -2, 10, 4, 11number3
12345678
-55-24-210411
01000000
012345678
0-20000000-23
first negposition
a bit convoluted butwould this be ok if tidied up ?

<colgroup><col span="13"></colgroup><tbody>
</tbody>
 
Upvote 0

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
24,348
This solution uses names

Name: FirstCell RefersTo: =Sheet1!$A$3
Name: LastCell RefersTo: =Sheet1!$H$3
Name: dataRange RefersTo: =FirstCell:LastCell

Name: AdjustedRange
RefersTo: =INDEX(dataRange,1, MIN(IF(dataRange>Sheet1!$K$1,COLUMN(dataRange)))):LastCell

Then the formula =MIN(IF(AdjustedRange<0,COLUMN(AdjustedRange))) should return the column number of the cell in question.

Note this column number is relative to the sheet, not the dataRange
 
Upvote 0

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
38,150
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
I think this array-entered** formula may ultimately break down to be the same as Mike's formula (I did not check), but without the Defined Names...

=MIN(IF((INDEX(3:3,,1+MIN(IF(A3:H3>3,COLUMN(A3:H3)))):H3)<0,COLUMN(INDEX(3:3,,1+MIN(IF(A3:H3>3,COLUMN(A3:H3)))):H3)))

**Commit this formula using CTRL+SHIFT+ENTER and not just Enter by itself.
 
Upvote 0

Forum statistics

Threads
1,190,833
Messages
5,983,140
Members
439,825
Latest member
glen3265

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top