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

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
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,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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