Count number of cells upward, where price is lower than current cell

loudnoiseman

Board Regular
Joined
Dec 31, 2004
Messages
219
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone,

Sorry if this seems confusing.

But instead of looking downward, I want the formula to look upward and return a count of the number of cells for the first instance where the price drops below current cell.

In this example, if current cell is 40, then the answer would be 5, as 34 is 5 cells above current cell price 40.

Thanks!!

50
49
48
47
46
45
34
44
43
42
41
40
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Try:
Book1
AB
1
250
349
448
547
646
745
834
944
1043
1142
1241
13405
Sheet4
Cell Formulas
RangeFormula
B13B13=ROWS(A2:A13)-XMATCH(TRUE,A2:A13<A13,,-1)
 
Last edited:
Upvote 0
Solution
工作簿1
ABCD
150
249
348
447
546
645
734
844
943
1042
1141
12405
13
Sheet1
Cell Formulas
RangeFormula
C12C12=ROW(A12)-XMATCH(1=1,A1:A12<A12,,-1)
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

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