Best thought is an iF statement that if unit price is 1 it will be a 6 character/digit that starts with the AB followed by unit price. Thanks!
Best thought is an iF statement that if unit price is 1 it will be a 6 character/digit that starts with the AB followed by unit price. Thanks!
Last edited by itshere; 04-25-2022 at 12:55 PM.
Try
=MID(B2,FIND("AB",B2,1),6)
text in B2
If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
is there an IF statement that can be derived from this?
issues with that because the second line already has AB12 so it uses that instead of the AB2000
Try the following:Formula:
=MID(SUBSTITUTE(B2,"AB","/",(LEN(B2)-LEN(SUBSTITUTE(B2,"AB","")))/2),SEARCH("/",SUBSTITUTE(B2,"AB","/",(LEN(B2)-LEN(SUBSTITUTE(B2,"AB","")))/2))+1,1)
Let us know if you have any questions.
Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.
=findAB(B2)![]()
Function findAB(r As Range) As String Dim t() As String xstr = r t = Split(xstr, " ") For i = 0 To UBound(t) x = Trim(t(i)) If Left(x, 2) = "AB" And Len(x) = 6 And IsNumeric(Mid(x, 3, 4)) Then findAB = x Exit Function End If Next i findAB = "" End Function
Next time... please read the yellow banner (top) and attach an Excel sheet to work with... not a picture of one.
=FILTERXML("<A><B>"&SUBSTITUTE(A2," ","</B><B>")&"</B></A>","//B[starts-with(., 'AB') and string-length()=6]")
Glenn
None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks