Excel Pulling Text within Cells - excel

So I have a cell that contain this text string. I was wondering if I can pull the text between from and upon. So it captures AAA (being varying degree of length)
life insurance policy #111 111 111 for the amount of $500,000.00 from AAA upon the life of xxx
So far I only managed this:
=MID(STP_Data!D71,FIND("from",STP_Data!D71), 42)
But if the text length changes it wouldn't capture it. Also how would I not capture from within my formula. Since my currently formula will include 'from' when it is pulled. Thanks guys!

How does this work?
=Trim(SUBSTITUTE(MID(A1,SEARCH("from",A1),SEARCH("upon",A1)-SEARCH("from",A1)),"from",""))
Edit: Added TRIM() per Scott's suggestion.

Related

How to extract the text between many commas in excel

I have a problem to extract the suburb from a address.
For example, the dress is "143 Stephanie St, Upper Kedron, QLD, 4055."
How to set up a formula to extract the buburb, Upper Kedron, from the address?
I really appreciate your review :)
This will extract second word separated by comma:
=TRIM(MID(SUBSTITUTE(A1,",",REPT(" ",255)),255,255))
You will have problem if Upper Kedron is not 2nd word like for example:
143, Stephanie St, Upper Kedron, QLD, 4055 (this will extract Stephanie St).
So if you have cases that formula doesn't work give us more inputs.
As per the previous answer, looks like your suburb can be in any position. So the best way is to split the address to multiple columns and then choose a column of your suburb.
=TRIM(MID(SUBSTITUTE($A1,",",REPT(" ",999)),1+((COLUMN(A1)-1)*999),999))

Single Line to Double-line Formatting in Excel

In my job I have to enter warranty information so that POs can be cut. Vendors are very particular with how this is entered and each one has their own format.
One of them requires data be entered:
SN:
MACHTYPE:
Further, the information for this is sent in a single composite number, something like:
10Y754235FUYJ9
Requiring the final input of data to be:
SN:10Y75423
MACHTYPE:UYJ9
The first 4 digits of the composite are the MACHTYPE and the final 8 are the Serial Number.
The impasse I've reached is I can't seem to get auto-fill to replicate the skipping of lines as I've formatted. It will jump a number of lines equal to however many I've selected.
Any ideas about getting it to replicate the first four Formatted Data? I've been throwing myself at this for a couple hours now.
Thanks in advance!
I think you're over complicating it by using two rows for the Formatted Data. I'd wrap the text (Home tab > Alignment section) for the cells in column F and use the following formula to insert a new line:
=CONCATENATE("SN:",B1,CHAR(10),"MATCHTYPE:",C1)
Then just leave the formatting like you had it by row...
Okay, let's focus on the title. When A1 is 10Y754235FUYJ9,
="SN:"&LEFT(A1,8)&CHAR(10)&"MATCHTYPE:"&RIGHT(A1,4)
will give you the output:
SN:10Y75423
MATCHTYPE:UYJ9
And don't forget to set the wrap text checked at Format Cells menu.

Excel First Word (with error checking)

While I can extract the first word from a cell containing multiple text values with error checking to return the only word if no multiple values exist. I cannot seem to wrap my brain around adding more checks (or if it is even possible in the same nested formula) for situations where some of the source cells contain a comma between multiple words. Example, the formula below will return "James" from "James Marriott". But, it returns "James," from "James, Marriott". If all of my cells in the range were consistent that would be easy, but they aren't. Attempts to nest multiple find statements have resulted in failure. Suggestions?
=IFERROR(LEFT(A1,FIND(" ",A2)-1),A2)
To compound matters, there are also cells that contain abbreviations as the first word, so somehow I need to account for that as well. For example "J.W. Marriott" where I need to apply the above logic to extract "Marriott".
Here are some examples below:
Text Desired output
James Marriott James
James, Marriott James
Able Acme Able
Golden, Eagle Golden
J.W. Marriott Marriott
A.B. Acme Acme
you could use regex (to set up please look at the post here)
Then you can extract the desired word with a formula like:
=regex(A1, "(?![Etc])[a-zA-Z]{2,}")
(This is searching for a pattern of two or more lower or upper case letters in the cell A1...and not searching for Etc)

How do I extract text between two commas in Excel?

How do I extract text between two commas in Excel?
92 4th Street North, Providence, RI 02904
In this case, how would I extract "Providence" substring using simple Excel formulas (LEN, FIND, LEFT, RIGHT, etc)?
Try the following formula.
=MID(A2,FIND("^",SUBSTITUTE(A2,",","^",1))+1,FIND("^",SUBSTITUTE(A2,",","^",2))-FIND("^",SUBSTITUTE(A2,",","^",1))-1)
Try the following formula
=LEFT(RIGHT(A1,FIND(",",A1)),FIND(",",RIGHT(A1,FIND(",",A1)))-1)
Considering your data is on A1
#RAJA-THEVAR's formula worked very well for me with a list of over 2500 addresses, as long as the address only contained two commas. With an address like "100 Washington Street, Suite 225, Denver, CO 80220" it returns "Suite 225." I used the following formula to identify and addresses that contained more than two commas:
=LEN(A1)-LEN(SUBSTITUTE(A1,",",""))
Many of these many-comma addresses had strange formats or information, and I found it better to fix them by hand.

Excel 2010 index match - multiple criteria

I am new to using index/match, and I'm facing some trouble. I have two worksheets, one with table act and the other with table wa. act contains 7,199 rows; wa has 25,099 rows.
I am trying to match order number and date in order to pull a document number from wa onto act. The order numbers will be an exact match, but the date on act is slightly less than the date on wa.
My formula is:
=INDEX(WA[BillingDocumentNumber],(MATCH([#[Customer PO Number]],WA[PO],0)+MATCH([#[GL Posting Date]],WA[CostPostedOn],-1)))
Depending on how I sort the wa data, I have gotten the following results:
494 document numbers returned (sometimes correct; sometimes pulling from the cell in wa directly beneath the cell that should be returned) with the rest #N/A;
approximately 1400 document numbers (all incorrect, I think) with the remaining being either #N/A or #REF
Can anyone help me? I have no practical knowledge of VBA, but I am the resident Excel "expert" (seems funny to me) in my company, so I am the person who is faced with the task of solving this problem... I have combed the existing forums, but I haven't found any that seem to provide a (non-VBA) solution for my problem. Any ideas would be greatly appreciated!
Thank you for your time.
Here is my untested proposed solution:
{=CONCATENATE(IFERROR(IF(AND(WA[PO]=#[Customer PO Number],WA[CostPostedOn]>#[GL Posting Date]),WA[BillingDocumentNumber],""),""))}
Entered as an Array Formula using CTRL + SHIFT + ENTER.
This will return in one text string all results that match the PO number and in which the act date is older than the wa date. You can modify your second and add a third conditional in the AND to create date ranges (ie WA[CostPostedOn]>=#[GL Posting Date]+7 or WA[CostPostedOn]<=#[GL Posting Date]-7).
As you are using arrays though there might be some performance issues when you scale this to 7,000+ formulas. Sadly you can't do a VLOOKUP with 2 conditionals.
Hope this helps. Cheers,

Resources