Searching Irregular Strings
May 1, 2007
I am trying to parse stock holdings for certain companies but I am running into trouble because they are not uniform in their form. The data has a general form but each company uses a slightly different style for the forms. These differences are hamstringing my efforts to effectively parse the data. I have attempted to parse the data using the split function to get it into a more manageable form, and then use various comparisons to tease out the right information. This, however, has not panned out like I hoped. Below are some sample data forms and some of my (albeit poorly written and structured) VBA to try and solve the problem.........
I am trying to extract the same fields from each, such as name or number of shares:
3COM CORP 885535104 1,700,000
Prudential Financial, Inc. 432848109 100,000
this would be a desired output.
here is some of my code to try and accomplish this. this seems to work the data if it is formatted correctly, but I would like write a general parser, and this is what I am struggling with. I cannot figure out how to write something that will correclty parse these irregular strings.
txt = ActiveCell.Value
x = Split(txt, " ")
name = ""
cusip = ""
shrs = "".....................
View 2 Replies
ADVERTISEMENT
Aug 12, 2014
I want to search a longer text field for a shorter string that may be within it. However, I want to do this for multiple short strings.
For instance:
PhraseHidden word
Please search the text for the hidden message: Blue
The hidden word, Green, may be at any point
And the word may be different lengths like Yellow
I have a table of the hidden words (Blue, Green, Yellow, Pink)
I know I could use search to find one word, but is there a way to look for multiple words, and return the value of which one it finds? I have many hidden words (and the list is dynamic) so I don't want to just split into multiple searches.
View 5 Replies
View Related
Aug 4, 2009
What I would like to have done is to look for each cell in column M with only the string of "note" in it, then look one cell below and to search the text using boolean operators and if certain words are found, increment a series of counters.
For example, using cells M16 and M17 as references, if "please" AND "relationship" AND "customer" are found within the text, create a counter and increment it by 1. The program should loop through all of the cells in column M and determine how many instances of that particular set of words is found. If there are 20 instances in the column then somewhere on the sheet, counter 1 should indicate 20.
There are a couple other set of words I would like to search as well, with each new set creating a new counter and indicating the total instances found of that particular set of words. For example, in cells M40 and M41 I would like to search for "failing" AND "name" AND ("first" OR "last"). Thus, if there were 50 of these instances a second counter somewhere on the sheet would indicate the number 50 when the program finishes.
I was using the find and replace but I don't think I can use boolean operators with it, and I'd also like to learn how to do this programmatically.
View 4 Replies
View Related
Apr 26, 2006
field b831 B831 write AASLQ0300000l;
PCPACIMTAAABl [B29 ]
field B7 b7 ;
field a8 @latestdate("PCP2EHSEAAAAh", jEnd);
field b8 @if(a8 <jStart, @latest("PCP2EHSEAAAAh", jEnd),
@avg("PCP2EHSEAAAAh", jStart, jEnd));
--------------------------------------------------------
I want to look through this text and copy out any 13 character codes that
are present (e.g. "PCPACIMTAAABl" ,2 "PCP2EHSEAAAAh").
These codes all share the following characteristics,
1) they are all 13 characters in length
2) the last character in the code is always either a "l", "h" or a "c".
3) they contrain no spaces
4) the first 12 characters are always in CAPS (followed by a lower "l", "h"
or a "c".
View 9 Replies
View Related
Oct 22, 2013
I receive a spreadsheet with over 400 lines of data every month. One row (J) contains information from companies with account details. The problem is that the info uses different formats, so the data strings within the cells can be quite long (sometimes over 100 characters, including spaces, dashes and slashes). The one identifier within each data string is a name, usually somewhere in the middle.
So for example a reference to JOHN SMITH might be "123456-01-smith/john-01/01/10-London-Edinburgh" or "2010-01-01-123456/SMITHJOHNMR/123456". I have a list of names (Column Y) and what I need is some way (probably VBA) for Excel to look down the list of references and compare them to the list of names, and if one of the names appears anywhere with in a text string, to put the name in column K. So if 4546/JohnSmith-01/08/13 or Leeds-London-123SmithJohn789 appears, put John Smith in column K, if 0123-MrFredBlogs-0321-5 appears, put Fred Bolggs in column K.
View 6 Replies
View Related
Sep 12, 2008
I am trying to search a cell for multiple different strings and if the string is found, multiply a nearby cell by a factor of 1.5. if the strings are not found i want the original cell value to be used. I have tried using find functions but they do not seem to work. I have also tried using nested if functions with no luck..
View 9 Replies
View Related
Dec 20, 2012
I need to do a vlookup that takes a string from one cell and then tries to find that string (embedded in a larger string) in the table array
Essentially I imagine this involves the FIND function at some point.
Attached is an incredibly simplified example of what I'm looking for.
View 9 Replies
View Related
Sep 14, 2009
Without using helper columns, what is the best way to return a value from an array using three criteria from irregular data? The attached sample gives and example.
View 10 Replies
View Related
Sep 9, 2013
I'm trying to extract specific character from a set of text strings which have irregular patterns. For example:
CJWHCon.D005 - JN Holding Inc Corporate
CUSViWind.D404 - Windows Ringtown Vinyl
My goal is to get only the 'DXXX' which sometimes might be only 'DXX'. I've tried using the following formula but I seem to be going wrong somewhere as I only get 'D'.
=MID(F10,FIND(".",F10)+1,FIND(" ",F10,FIND(" ",F10)+1)-1-FIND(" ",F10))
View 2 Replies
View Related
Jan 22, 2013
I need to write a macro which inserts rows such that each ID has exactly 10 rows (1 for each brand). The difficulty is that each ID has a varying number of blank rows required.
ID
brand
10
1
10
3
[Code] ..........
View 9 Replies
View Related
Jul 18, 2013
im looking for a way to sort some data exported from an old stock recording software. the system outputs the data as a .csv file but each item bought is grouped into a particular heading, a line is only generated if money is spent under that particular heading. i cannot make the software generate lines if no money is spent so the number of lines generated each period changes.
period 1
3202 fuel £3000
3203 PPE £250
3204 major units £5000
3205 planned maint £212
3207 unplanned maint £457
period 2
3202 fuel £2500
3203 PPE £120
3204 major units £1000
3208 storage £212
3210 windows £457
if the data was regular i could simply add the totals each month and divide to get the average.
what i am looking for is a way to auto sort the data onto lines by possibly injecting the missing headings with zero as the total spent.
View 1 Replies
View Related
Dec 16, 2013
I have an excel worksheet with about 10K rows of data in column A.
I have also another list of data, about 200 rows of data, in column G.
I need to color each cell in column A that contains, anywere in the string, any of the data strings in column G.
Example:
in column A
row 1: info@duende.com
row 2: rasko@silvester.com
row 3: supportonline@fabius.com
row 4: myhelp@friday.com
in column G:
row 1: help
row 2: info
row 3: support
I need rows 1, 3 and 4 in column A to be colored.
View 9 Replies
View Related
Jan 3, 2014
I've tried for some time now to create a chart where the x-axis make up for irregular dates. Making the line between 2 points longer if it's long time between them and short if it's short time between them.
I've finally understood line charts doesn't support that and I have to use scatter graph. It seems to work but the dates, the get all messed up. I type 2014-11-11 but the x-axis in the graph shows 2283-12-12 or something like that.
Got a notion that I might have to transform it to the date value manually first but I get #VALUE ERROR
i.e. 2014-11-11 in A1, then I type in A2 =DATEVALUE(A1).
How do I get a chart to work with irregular dates correctly?
View 4 Replies
View Related
Jun 21, 2007
I regularly import a list of data into Excel containing employee team names, employee names, and (for these purposes, irrelevant) data. The team name is the only data in column I, and therefore I can easily pick this up an summarise it in a lookup. The employee name is always one row above it, and in column D. However, it is not the only data in column D, and each employee's records contain varying numbers of rows. How can I have Excel copy the employee name in to column J, alongside the team name in column I, but ONLY in rows where there is data in column I?
View 3 Replies
View Related
Jun 21, 2014
I am trying to copy several columns into another sheet within the same workbook.
I want to copy Columns 1,2, 15, 19, 23, 40.
I don't know how to work with arrays.
View 4 Replies
View Related
Mar 1, 2010
i have written a macro to parse data in to four columns using the text to columns fixed width option, but unfortunately the data i get changes its spacing and configuration every day, meaning that the fixedwidth columns dont separate the data correctly. below is how it looks some of the time.
46632hac5 Jpmcc 2007-ld12 a5 19,340,005 315
0738qac5 bscms 2007-pw17 a5 23,142,005 265
61746wcz5 msdwc 2000-prin a5 3,600,005 305
32108hp75 bacm 2007-2 a5 2,000,005 465
46630edf5 lbubs 2006-c1 a5 1,000,005 285...............
View 9 Replies
View Related
Feb 28, 2014
I have a file with many different row sizes and after calculating the figure, we will need to add up the total for a particular job. Due to the irregular data on each job (some with only 1 line item where sometimes the job have few line items).
The cell to sum already has a formula for the data.
For example, I already have a formula on Column L to get the figures. After few line items, I will need to add a total to the lines item, also on Column L. I think we can uses 2 sets of data from 2 different column as "pointers", Column D and the formula column itself (but I don't know how to). The columns that I need a sum function will be from Column L to X. After doing the sum, can we at the same time draw a sum line? (single top line and double bottom line).
Am I being "too greedy" ? Imagine if we have more than thousands lines of such data to be added manually and to draw these lines manually.
View 3 Replies
View Related
Aug 14, 2014
I use excel and would like to know how to copy a large volume of address data but at the same time filtering out irrelevant data placed under each other in a row, in this case, air compressors air conditioning web address etc ( see below for example). I need the first 5 lines only. The rows of unwanted data are irregular i.e some have 10 lines, others 5 , and others 2 or one line which makes using a formula difficult as there is no consistency. The data eventually need to be placed horizontally in columns to be compared to other address lists. To make matters worse, the text data has been merged and wrapped.
BDD LIMITED
3 Telford Place
L*****r QLD 4315
Phone: 07 5777 3622
View 14 Replies
View Related
Jun 10, 2009
I have 1000's of columns of data to go through, I just need to visually inspect the data and then delete any column containing irregular data. At the moment; I select a section of the first column of data and insert a column chart for that data. I then need to change the source of the chart data to that of the next column, to do this I click on the data within the chart and it will show the data on the worksheet that I have selected by surrounding it in a blue box, I then click on this box and drag it to the next column of data. Clicking on the blue box (which sometimes I miss, and I then have to go back to the chart to activate it again) and dragging it to the next column is getting annoying, especially as I have sooooo much data to go through. Does anyone know if there is a shortcut key for this, or how I could write a macro to do this?
View 9 Replies
View Related
Mar 14, 2014
I have a dataset where the dates are in the following format:
19970803 = 3rd August 1997 (YYYYMMDD)
My aim is to sort the data into months and into 'turn of the month' periods.
-Is there a way to isolate rows using a search term like "****08**" for all the august entries?
-Likewise if i want data between 27th-3rd for every month is there a way to sort for entries between "******27 - *******03".
View 6 Replies
View Related
Sep 26, 2008
I feel quite stupid about this one as it seems easy at first glance, but I just can't figure it out ...
I have a table with 4 columns (A B C D)and need to output in a 5th column (RESULT) the value that is most at the right on each line. The trick is that this value can be in any of the 4 colums, and is not always the biggest (max) value ...
P
A B C D RESULT 1 2 2 2 1 1 4 3 3 1 2 3 4 4
View 9 Replies
View Related
Oct 13, 2009
I have doc with app 1000 rows of data, one col being product description. I want to simply search the entire description column for a particular string of characters and enter a 1 in a new adjacent column where there is a match. Where there is no match, I want a 0 or a blank.
View 3 Replies
View Related
Apr 24, 2007
I'm wondering what function I can use to search a specific word in row with many text?...
i attached for the example and details.
View 10 Replies
View Related
May 10, 2007
I am trying to create a search facility to search for accreditations.
currently my search only picks up on the first word in the cell.
ie Prince will be found in Prince 2 Foundation, but a search on foundation comes up with nothing.
How do i get the search to search all the text in the cell and not just the first word.
I am searching on a number of worksheets but in the same range on each worksheet.
View 9 Replies
View Related
Jun 26, 2007
I need to be able to search through category(column H) and match with machine size category. Then for each category split up total time spent on each function. Granted this will be 6 formulas. I've searched through the forums and came up with what I have....
View 10 Replies
View Related
Aug 14, 2008
I have 180,000 names in a spreadsheet with unique codes for each, I need to search for names and find their code numbers, how can I do this over a series of 8 columns.
Code Name code Name code Name Code Name
I'll need to search columns 2, 4, 6 and 8 for the name?
View 9 Replies
View Related
Mar 3, 2009
Have the following scenario I'm struggling with in Excel 07:
2 worksheets:
WS1, have a bunch of customer data. Relevant columns in this WS include customer number (unique value) and a column called "adjustment date", which is formatted as a date as the label name implies.
WS2 is a bunch of customer transactional data, with each row being a unique transaction. Relevant columns here include customer number (formatted same as in WS1) and transaction date.
Couple things to note: in WS2, each customer may have dozens of transactions. Right now, I have that WS sorted by transaction date in ascending order (so oldest to newest).
What I'm trying to do (unsuccessfully so far!) is build a formula in WS1 that says "on what date was the customer's first transaction after their adjustment date"?
I've tried constucting something using =index+match, but to no avail.
View 10 Replies
View Related
Jul 24, 2009
I have a workbook with 100+ tabs(not in alphabetical order), and am constantly scrolling back and forth looking for tabs, is there a quicker way to search tabs? I have also right clicked the arrows to pull up the box with all tabs, but not the best option either.
View 7 Replies
View Related
Feb 3, 2007
Just trying to find a formula to look for duplicate entries in the same workbook or a single column
View 2 Replies
View Related
May 20, 2007
This is my problem:
Column A contains letters
Column B contains numbers
Column H contains data
I need a formula that will do the following:
Lets say cell M1 contains a certain letter, and cell N1 contains a certain number. I need to find the row on the spreadsheet that has the letter shown in M1 in column A and number shown in N1 in column B. Once the row is found, I need to return the data in column H of that row.
View 5 Replies
View Related