Solved

Parse out field

Posted on 2013-05-16
14
242 Views
Last Modified: 2013-05-16
I have the following fields that I need to pull data out of.  

PERCEPTIVE SOFTWARE, I#9005197267
CAREMEDIC, MEDICARE RT SUBSCRIPTION I# 5545926
RECLASS A007265 I#3076 TO BLDG IMP, MAR 2013
RECLASS A007265 I#3149 TO BLDG IMP, MAR 2013
RECLASS A007265 I#3154 TO BLDG IMP, MAR 2013


I want to pull the data for I#.  so the results would look like this:

9005197267
5545926
3076
3149
3154
0
Comment
Question by:Scotto111
  • 7
  • 4
  • 3
14 Comments
 

Author Comment

by:Scotto111
ID: 39172497
I have planned to make 2 formulas and combine them together.  This will allow for the 2 types of examples to use different formulas.
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39172539
This takes care of all the given cases

=REPLACE(TRIM(REPLACE(A9,1,FIND("I#",A9)+1,"")),FIND(" ",TRIM(REPLACE(A9,1,FIND("I#",A9)+1,""))&" "),9999,"")
0
 

Author Comment

by:Scotto111
ID: 39172557
I converted this to Monarch format:
=REPLACE(TRIM(REPLACE([Description],1,Instr("I#",[Description])+1,"")),Instr(" ",TRIM(REPLACE([Description],1,Instr("I#",[Description])+1,""))&" "),9999,"")

What is the &" "),9999 doing?

Monarch doesn't like the &.  Any ideas?  I know this isn't Monarch forum.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39172570
Can you upload a fake file with this?
0
 

Author Comment

by:Scotto111
ID: 39172574
text file? or monarch file?
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39172598
Monarch
0
 

Author Comment

by:Scotto111
ID: 39172614
ssaqibh,
Too much work to clean the data and send it.  I am in a time crunch.  Really appreciate your help.  

I have 2 types of data in one field:
Type 1:
V# M667938 I# 9005044233 F# EMC R# 0000318829 Remit to: PERCEPTIVE SOFTWARE
V# M667938 I# 9005197267 F# EMC R# 0000318829 Remit to: PERCEPTIVE SOFTWARE
V# M668008 I# 10727008 F# EMC Vendor: KRONOS
V# M000379 I# 5545926 F# EMC Vendor: CAREMEDIC SYSTEMS, INC.
V# A001761 I# DUES13-H13022 F# EMC Vendor: CHA/CAHHS

Type 2:
PERCEPTIVE SOFTWARE, I#9005197267
CAREMEDIC, MEDICARE RT SUBSCRIPTION I# 5545926
RECLASS M000521 I#134914 PO#342533 TO EXP, MAR 13

For type 1 I have this working:
If([I#]>0,(Mid_XL([Description],[I#]+3,[F#]-[I#]-4)),"")

Can you use this to make a formula that will work on both?  Or even one that will work on Type 2 and I can combine them.
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39172635
I have never used these tables so I might not be able to set it up appropriately. Can you just feed the above data in a new file and set it up accordingly?
0
 

Author Comment

by:Scotto111
ID: 39172643
0
 

Author Comment

by:Scotto111
ID: 39172645
I posted the data into a text file.  Not sure how to set up model in monarch to send with it.  Hope you can help.
0
 
LVL 81

Accepted Solution

by:
byundt earned 500 total points
ID: 39172687
& is the concatenation character in Excel. The following two formulas are equivalent:
=TRIM(LEFT(SUBSTITUTE(TRIM(MID(A1,FIND("I#",A1)+2,99)) + " "," ",REPT(" ",99)),20))
=TRIM(LEFT(SUBSTITUTE(CONCATENATE(TRIM(MID(A1,FIND("I#",A1)+2,99)), " ")," ",REPT(" ",99)),20))

REPT is a function that returns multiple copies of specified text, in this case the space character.

Another way of avoiding concatenation uses the IFERROR function:
=TRIM(MID(A1,FIND("I#",A1)+2,IFERROR(FIND(" ",A1,FIND("I#",A1)+3)-FIND("I#",A1)-2,99)))
0
 
LVL 81

Expert Comment

by:byundt
ID: 39172726
Could you nest If functions within the Monarch string?
If([I#]>0,(Mid_XL([Description],[I#]+3,If([F#]>0,[F#]-[I#]-4),99)),"")
0
 

Author Comment

by:Scotto111
ID: 39172834
It can't do nested Ifs.  Can you make 2 separate fields for me - for each type of data?
0
 
LVL 81

Expert Comment

by:byundt
ID: 39173077
I don't know the syntax of Monarch formulas, but the following seems to me as though it would work:
Val(ltrim(lsplit(Description,2,"I#",2)))

Take the Description field and split into two parts at I#. Return the second part.
Remove any leading spaces from the previous returned value
Convert the previous returned value into a number. Conversion will stop at the first character that isn't a leading sign or digit.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question