Formula to return the preceding cell which has a text string.

oscark37

Board Regular
Joined
Nov 23, 2015
Messages
56
I have a column B which has a mix of numbers and text. I want to put a formula in column A that when there is a number in column B of the same row, returns the next cell moving upwards that starts with text.

For example, the formula in A6 would return BEL023.

Any ideas?


Column AColumn B
AOF010
112823
BEL023
12121
323232
1321212
JEF233

<tbody>
</tbody>



Thanks,

Oscar
 
Last edited:

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Maybe...


A
B
1
Formula​
Values​
2
AOF010​
3
AOF010​
112823​
4
BEL023​
5
BEL023​
12121​
6
BEL023​
323232​
7
BEL023​
1321212​
8
JEF233​

Formula in A2 copied down
=IF(ISNUMBER(B2),LOOKUP(2,1/ISTEXT(B$1:B1),B$1:B1),"")

M.
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,936
Members
449,094
Latest member
teemeren

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