Good day,
I want to get the BUYER from the transaction. One of the member here, Ron, was kind enough to provide me with the TEXTAFTER & TEXTBEFORE formula.
Previous Transaction:
1) Peter sell 10 apples to May
2) Jon sell 3 pears to Wei Liang
3) Tom sell to William 4 oranges
4) Ellen sell 1 banana to Andy
Who is the Buyer
1) May
2) Wei Liang
3) William
4) Andy
formula to get Buyer:
=LET(ta,TEXTAFTER(A2,"to "),TEXTBEFORE(ta,{0,1,2,3,4,5,6,7,8,9},1,,,ta))
The formula work, but now I have a new type of Transaction:
1) Peter sell 10 apples to May
2) Jon sell 3 pears to Wei Liang
Note: No plastic bags
3) Tom sell to William 4 oranges
Note: Delivery within 1 day
4) Ellen sell 1 banana to Andy
Now some transactions have an additional line. So for 2) and 3), using the formula will give me the extra lines for Buyer.
How should I exclude newline in the TEXTBEFORE? I tried adding vbNewLine in the formula but got error.
If you are using
MS365then this can be accomplished as well usingExcel Formulas:• Formula used in cell B2
Even this would work, if there is
Note:after eachBuyer:Edit 3/25/2024:
As per OP's comments --
Formula remains same, without any single changes done to it. Screenshot updated to show its still working on my end.