Solved

Parse out field

Posted on 2013-05-16
14
235 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

776 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