Formula to get the value of a cell before and after a specific char

bezbid

New Member
Joined
Nov 27, 2016
Messages
21
Office Version
  1. 365
  2. 2016
  3. 2010
  4. 2007
Book1
ABCDE
152.01048.635.0
250.220
348.630
446.640o
545.150o
643.460o
741.770o
840.180o
937.390o
1036.8100o
1135.0110
1233.4120
1331.6130
1430.0140
1528.4150
1626.6160
1725.0170
Sheet1



What is the formula for D1 and E1, which get the cell value of column A one row before and after, when cell in column C = "o", thanks for the help.
 

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).
How about
Fluff.xlsm
ABCDE
1521048.635
250.220
348.630
446.640o
545.0750o
643.460o
741.7370o
840.0880o
937.2590o
1036.8100o
1135110
1233.4120
1331.6130
1430140
1528.4150
1626.6160
1725170
Main
Cell Formulas
RangeFormula
D1D1=INDEX(A1:A100,XMATCH("o",C1:C100,0)-1)
E1E1=INDEX(A1:A100,XMATCH("o",C1:C100,0,-1)+1)
 
Upvote 0
Book1
ABCDE
152.01050.226.6
250.220
348.630.001
446.640.001
545.150o
643.460o
741.770.001
840.180
937.390o
1036.8100o
1135.0110o
1233.4120
1331.6130o
1430.0140
1528.4150.001
1626.6160
1725.0170
Sheet2


Hi Fluff,

I have a new issue with this, what is the formula for D1 and E1, to get the before and after value of Col. A, if the column B value has decimal value .001, thanks
 
Upvote 0
Another option for the original question.

bezbid.xlsm
ABCDE
1521048.635
250.220
348.630
446.640o
545.0750o
643.460o
741.7370o
840.0880o
937.2590o
1036.8100o
1135110
1233.4120
1331.6130
1430140
1528.4150
1626.6160
1725170
Sheet1
Cell Formulas
RangeFormula
D1D1=XLOOKUP("o",C2:C100,A1:A99)
E1E1=XLOOKUP("o",C1:C99,A2:A100,,,-1)



For the new question, does this do what you want?

bezbid.xlsm
ABCDE
1521050.226.6
250.220
348.630.001
446.640.001
545.150o
643.460o
741.770.001
840.180
937.390o
1036.8100o
1135110o
1233.4120
1331.6130o
1430140
1528.4150.001
1626.6160
1725170
Sheet2
Cell Formulas
RangeFormula
D1D1=XLOOKUP("*.001",B2:B100&"",A1:A99,,2)
E1E1=XLOOKUP("*.001",B1:B99&"",A2:A100,,2,-1)
 
Upvote 0
Book1.xlsx
ABCDE
152.01046.626.6
250.220
348.630
446.640
545.150o
643.460o
741.770.001
840.180.001
937.390o
1036.8100o
1135.0110o
1233.4120.001
1331.6130o
1430.0140
1528.4150.001
1626.6160
1725.0170
Sheet2


Thanks for the help. is there a formula for D1 & E1 that can apply for both conditions, that is either the .001 or o ? as the data in Col B and C changes every time
 
Upvote 0
Try

bezbid.xlsm
ABCDE
1521046.626.6
250.220
348.630
446.640
545.150o
643.460o
741.770.001
840.180.001
937.390o
1036.8100o
1135110o
1233.4120.001
1331.6130o
1430140
1528.4150.001
1626.6160
1725170
Sheet3
Cell Formulas
RangeFormula
D1D1=INDEX(A1:A100,AGGREGATE(15,6,SEQUENCE(ROWS(A1:A100))/((RIGHT(B1:B100,4)=".001")+(C1:C100="o")),1)-1)
E1E1=INDEX(A1:A100,AGGREGATE(14,6,SEQUENCE(ROWS(A1:A100))/((RIGHT(B1:B100,4)=".001")+(C1:C100="o")),1)+1)
 
Upvote 0
Solution

Forum statistics

Threads
1,214,641
Messages
6,120,695
Members
448,979
Latest member
DET4492

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