Formula Needed for Identifying Higher Number AFTER Lower Number Identified

matthewlouis

Active Member
Joined
Mar 28, 2014
Messages
374
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I have a number in $A$2. I have another number in $B$2

In Column C, I have 60 rows of numbers.

In Column D, I have another 60 rows of numbers

In Column E, I have a formula that identifies when a number in Column C is less than $A$2. Let's say C30 is the cell that contains that number that is lower than $A$2.

Once cell C30 has been identified, I then need a formula that will look at Column D and identify the number that is HIGHER than $B$2. This identification must occur ONLY after Cell C30 has been identified, not before.

I need the first occurrence only, none after that.

Does anyone have an idea how to do a formula for that? I don't do VBA, I need a formula.

Thanks in advance!!
 
DUH! My bad, you're right, sorry. Didn't mean to skip that.

So the 12 prints and then it looks for the next number in D greater than 30.

Sorry about that.
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
DUH! My bad, you're right, sorry. Didn't mean to skip that.

So the 12 prints and then it looks for the next number in D greater than 30.

Sorry about that.

Row\Col
A​
B​
C​
D​
E​
F​
1​
2​
15​
30​
3​
4​
field-1field-2field-3field-4
5​
20​
5​
6​
12​
7​
12
7​
30​
9​
8​
2​
9​
1​
32​
32
10​
80​

In E5 enter and copy down:

=IF(1-ISNUMBER(LOOKUP(9.99999999999999E+307,$E$4:E4)),IF(C5<=$A$2,$C5,""),"")

In F5 enter and copy down:

=IF(ISNUMBER(LOOKUP(9.99999999999999E+307,$E$5:$E$10)),IF(1-ISNUMBER(LOOKUP(9.99999999999999E+307,$F$4:F4)),IF($D5>=$B$2,$D5,""),""),"")
 
Upvote 0
Your first formula worked GREAT, perfect. But the 2nd one did not (?) Here is my actual table, hope this helps explain it better.

SPLSPL HighHighCloseClosed Under SPLClosed Over High
262.71263.73
264.43264.07264.07Your formula returned this, it isn't right
265.52265.51
266.38266.31
267.32266.78
267.56266.75
267.22265.66
267.04266.51
268.60268.20
268.53267.17
268.33267.03
268.39267.58
267.64267.51
267.64267.51
267.44267.19
267.73267.32
267.92267.87
268.55266.86
270.64270.47
272.16271.61
273.56273.42
274.10273.92
275.25274.54
274.42274.12
276.12276.12
278.11277.92
280.05279.61
279.96279.14
280.41280.41
282.69282.69
283.62283.29
284.70283.18
284.27283.30
286.63286.58
286.43284.68
284.74281.76
283.30281.90
283.06281.58
280.23275.45
275.85263.93
269.70269.13257.63
272.36267.67should be 267.67 because it came AFTER the 257.63
268.17257.63
263.61261.50
267.01265.34
266.62266.00
270.00269.59
273.04273.03
275.32273.11
274.72270.05
273.05270.40

<tbody>
</tbody>
 
Last edited:
Upvote 0
See the 257.63 down some n the Close column?
 
Last edited:
Upvote 0
No, that 257.63 is the close under the low in A2, a calc I have somewhere else and is linked to this page.

I need to know when the Close is higher than the High AFTER that first calculation (your first formula) printed.

Why don't you just put what must be returned in E and F for the sample you posted?
 
Upvote 0
Because the 2nd calculation can't be done until the first one confirms. The 2nd formula you did put a number in the first cell. It should have been 267.67 in the CLOSE column which is the first close HIGHER than the SPL's High ($B$2).

So the E calc = 257.63

The F calc = 267.67

Again, your first formula nailed it, it's the 2nd one that doesn't work.
 
Last edited:
Upvote 0
That table I sent is messed up. Let me resend
To answer your question . . . YES . . . the E calc result = 257.63 comes from D (not from C)

YES . . . the F calc must come from C -- the answer is 267.01 from column C

Thanks for all your help on this, by the way, you're the best.

I'll resend table
 
Last edited:
Upvote 0
That table I sent is messed up. Let me resend
To answer your question . . . YES . . . the E calc result = 257.63 comes from D (not from C)

YES . . . the F calc must come from C -- the answer is 267.01 from column C

Thanks for all your help on this, by the way, you're the best.

I'll resend table

OK, messed up again here.

The E calc result = 257.63 comes from D AND the F calc also comes from D . . . they BOTH come from D. The first one is LOWER than $A$2 and the 2nd one is HIGHER than $B$2

I am so sorry I am all over the place but my table columns don't match your example and that's why I've been so off.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,129
Messages
6,123,210
Members
449,090
Latest member
bes000

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
Back
Top