Extract 1st Matching Substring From Cell
Nov 26, 2008
I am trying to make a simple formula to populate a cell with the first matching substring found in a data cell (from a fixed list of substring keys).
Example of desired results:
Substring data: {X, YY, ZZ} (typically 6 to 15 values in real world use)
Data..........Calculated result..........Comment
AAX.................X........................Substring X was found in Data.
ABC.............[empty]...................None of substrings were (X, YY, ZZ were found)
XYYZZ.............X......................(only first match need be returned)
ABCZZ.............ZZ....................Substring ZZ found etc….
I am looking for something cleaner than nested if statements since there are likely to be a lot of values and different variations. The work would then be to copy the formula and populate the list of substrings to search for in the data. I tried some array formulas using search() but no luck so far.
View 4 Replies
ADVERTISEMENT
Jan 16, 2008
(I need to do this using VBA so that it can work as an excel macro and/or a vba function in access.)
How can I extract the first occurance of any substring over a certain character length from within a string ?
eg. My string may take any of the forms given below (or something similar), how can I extract the first set of characters that is at least (say) 4 characters long ? i.e. always get the 'Phillips' out of the below...
Phillips Homes Ltd
Mr T A Phillips
TA Phillips Homes Ltd
T A Phillips Homes Ltd
T. A. Phillips Homes Ltd
The names used are only an example (Phillips could be any name whatsoever).I am familiar with Search, Len, Left, Right, Mid, Instr etc. but just can't figure this one out.
View 9 Replies
View Related
Apr 2, 2014
I am trying to extract the last substring in some text that I have. see below for example.
12/30-12/31 Bob Dylan 40.25
I need to extract the 40.25 out. Every line item may be different but the number I am extracting is always after the last space. I tried using mid and find but this doesn't work well when there is more than 1 space in the text.
View 4 Replies
View Related
Jul 19, 2012
I've found several posts about returning variable substrings that dealt with one or two spaces, but I have not been able to find anything that is for multiple spaces. The number of characters before the substring will remain constant.
For example:
Income from transmission agreement - 83 subs @ $0.44
In this case I need to extract: 83
Income from transmission agreement - 10,312 subs @ $0.50
Need: 10,312
View 8 Replies
View Related
Dec 20, 2013
I need to export this to Xcelsius which doesn't support any macros/vba. Btw I can;'t use Row() in xcelsius too.
[Code].....
View 4 Replies
View Related
Aug 9, 2012
I have two excel sheets. Lets say one is for May and another for June month. I have some data like name of account, account number their ratings . I wish to find if the account present in June month was present in May month sheet or not and if yes, then i need to extract a rating entry( column) from it and paste it in another sheet where i have copied all the data of June month so that i am able to see if the rating has changed over the months or remain same for that particular account...
i am trying vlookup but it is not able to search the name of the account even when it is present in the sheet( like WBIDFC) ... it seems the problem may be because of the format but i am not sure.... moreover i tried to vlookup via account no. but problem is that sometimes the account number is given and sometimes not.. Moreover , the format also does not match sometimes..
View 9 Replies
View Related
Jan 8, 2007
I have a flat file (see attched). What I want is to be able to choose a "Unit no" from a form combo box and a list of names linked to that unit to appear below
View 4 Replies
View Related
Aug 4, 2012
I have on excel file like this :
SKU PRICE QUANTITY
1........25...........4
2.........41..........9
etc......etc........etc
The second one looks like this :
SKU UPC
0...786876
1...44777
etc...etc
While the first file contains about 300 active products the second one has a list of about 2000 active and deactivated products. What I need is to extract the UPC from the second file matching the active SKU from the first file so I have a final file that looks like this:
SKU UPC PRICE QUANTITY
1..44777...25.........4
and so on.
View 1 Replies
View Related
Jun 2, 2007
I had a VBA excel question. I have 2 excel files. Each file has a column on product SKUs. What I need is a VBA function that compares the 2 key columns and extracts the matching SKU and saves them in a 3rd excel file. That is the 3 file should contain only the SKUs that are in both of the 2 files.
View 9 Replies
View Related
Jul 17, 2009
Heres what I need:
On the 'values' worksheet (first one), a formula in cell M2 that will search the worksheet 'oc_users' (second one) for any row containing "Active" in column G, these rows will return the corresponding email address in column A of the same worksheet. Skipping "Inactive" rows.
End result: anyone with an active status in oc_users will have their email populated in the 'values' worksheet.
View 9 Replies
View Related
Jan 28, 2010
I have a cell (A1) that contains text.
That text will match a single value in a reference list (i.e. range of cells e.g. Z1:Z26).
When the match occurs (e.g. A1 = Z16), I want the format of the reference cell (fill color, text color) to apply to the cell of interest (A1).
The reference cells are manually formatted.
I know that I could create a long list of conditional format formulas instead of using the reference, but it seems that there must be some way to tell excel: if the cell value contents are equivalent, the formatting should be as well.
View 9 Replies
View Related
Nov 19, 2009
programming 2 macros in a bank reconciliation sheet I am trying to create.
Basically the data consists of two sets: the ledger side and bank side. Both sides consists of multiple columns that include date, description and amount.
The following two situations can occur and which need to be covered with a macro.
Many to one matching
When we make payments to say 100 different suppliers at once, the ledger side will show 100 lines with the different amounts. However on the bank side it will only show one line with a total amount for the transaction. As the description on the ledger side is the same for all transactions done at the same time, it should be possible to have a macro add these lines and compare the total with entries on the bank side. Once a matching amount has been found, the macro should place an ‘x’ next to all entries on the ledger and bank side, in order to show that these transactions have been reconciled.
Partial cell matching
In this case we are only dealing with one line on both the ledger and bank side. The issue is that the description does not always perfectly match with one another. The ledger side might say ‘Brown Corp.’ and the bank side might say ‘Brown Corporation’. I want to come up with a macro that can recognize this partial match and still reconcile the lines by placing a ‘x’ to both the ledger and bank entry. The match however should be done with a combination of description, date and amount as several different bookings might be done for the same supplier in the same month.
View 12 Replies
View Related
Jan 13, 2009
I have attached the 2 workbook, master & transaction. From master workbook column F column name "EXIST DOCUMENT" values need to find in the transaction workbook column D column name "Documents". If match found in the column D substring field, it need to replace with column G column name "NEW DOCUMENT" value from master workbook.
The transaction workbook need to be given as input workbook, when the macro is get executed from master workbook.
View 2 Replies
View Related
May 20, 2002
I wish to search for a substring within an array of strings and just return back an indication that the substring exists withing that array.
so for instance let the substring be "rang"
and let the array be
{"apple","orange","lemon"}.
I wish to put a single command line next to my substring and wish to search through that range and return a key code if it exists. And then I will repeat the same search for other substrings. For the moment being, I don't care too much about the number of occurences or the exact cell address where they occur. All I wish to know is whether they exist in that list or not.
So it looks to me it is like a SEARCH command but except on a range of text (Rather than a single text) with an array formula. I have tried MATCH but my case is not an exact match either.
View 9 Replies
View Related
Sep 16, 2012
Using Excel 2010 Pro.
I have a formula to create a string to create a lable for a Trial Balance report
=LEFT(I5&" "&REPT(".",95),101)
But the decimal portion of the string is distracting. I would like to make it a grey instaed of a black so that the text portion of the label "pops".
I don't believe I can do it with conditional formatting and I do not want to do it manually.I was thinking some kind of function or UDF like:
=LEFT(I5&" "&RGB(REPT(".",95),(191,191,191)),101)
View 3 Replies
View Related
Dec 6, 2013
I have figured out certain formulas that can get me pieces of the text substring, I am having difficulty finding an all in one solution that will allow me to run a macro and automate this process due to the nature of variability of the # of characters in the text string. The category and what I need to extract is as follows (Michigan Missing Zips roll up I can deal with):
MWR - Illinois - HORIZONTAL LATHES
MWR - Illinois
MWR - Illinois - MACHINING CENTERS - HORIZONTAL & OTHER
MWR - Illinois
MWR - Illinois - MACHINING CENTERS - VERTICAL
MWR - Illinois
[Code] ..............
View 3 Replies
View Related
Jan 6, 2014
Let us say I have the following text in Cell A1. "There is a fault in the cal cycle.Need to update the records." And in cell A2 I have the following text. "Called for backup assistance. There is an issue with numbers." I cells B1 & B2 I need a particular formula which searches for the substring "cal" exactly and returns true if present. In cell A1, we have "cal" in the text. So it should return true for me in cell B1.
However in cell B2 I need false to be returned even though I have "Called" inside the text. I need true to be shown only for those cells where we have the exact text "cal" and no text characters in front or back of it.
View 3 Replies
View Related
Jan 16, 2010
I'm looking for a formula that can determine whether a given sub-string appears in a string. For example if cell A1 contains the string "bathing", and cell A2 contains the sub-string "bat", the formula in A3 would return "TRUE".
However, if the sub-string in A2 is changed to "cat", the result in A3 would be "FALSE". The formula would need to work with strings of different and unpredictable lengths.
View 2 Replies
View Related
Apr 18, 2013
So I have this problem in excel with comparing 2 columns.
Basically, I have 2 columns(a &B) that I need to compare with one another and find out the matching data. I am trying to use that matching data to enter in our reports.
Both columns might have duplicate items because I am dealing with premium numbers.
Formula to compare these 2 columns and find the matching data and extract it to a separate column. Keep in mind, i am dealing with almost 20,000 lines of data.
View 2 Replies
View Related
Jan 20, 2013
My task is to combine two large databases into one spreadsheet by extending the number of columns. The data from each database is 90% matching based on an identification number, however occasionally there are additional rows or unmatched identification numbers that need to be kept for analysis.
When this happens, there needs to be a blank row inserted to represent the missing data in the rest of the corresponding row.
I am having trouble finding a quick way to do this because I have approximately 12,000 rows (and columns up to DV when combined).
for example:
p1
data
data
data
data
p2
data
data
data
data
[Code] .....
needs to become:
p1
data
data
data
data
[Code] .....
I am guessing I will need a macro of sorts, So far I have made one column that tell me if the ID's are matching or not (1 or 0) and if they are not matching (0) I manually insert the rest of the row that is missing or make space for the duplicate data (which needs to remain).
View 5 Replies
View Related
Apr 28, 2014
I am working with a spreadsheet that has our user data; User(First) Name, User(Last) name, Computer Name, MAC address, Phone Number, Seating Position and Network Port Number.
I have let this get horribly out of sync, moved computers around, and moved them while the MAC address column was hidden, As a result, I have a bunch of users listed as being at the wrong computer. I have a second spreadsheet I generated that gives me the logged in user for about 2/3 of my computers, with the computer name(Just 2 columns, 'A' and 'B'. I would like to have Excel match the computer name and then overwrite the user name. For example, if the first computer in my correct user list is DELL-99945ty2, and the user name is "Jimbo Jones", I would like it to search the first Excel doc(The one with all of the user data), and replace the user name with "Jimbo Jones". Is this simple and straightforward?
In my main spreadsheet, the user name is in column B and the computer name is in column G, So I want to use the values from Column B in my second document to find its match in Column G of the first spreadsheet, and then replace the data in Column B with Column A in the first spreadsheet.
View 5 Replies
View Related
Feb 27, 2014
I have two tables, Table1 one has only customer codes in it, and I have Table2 with plenty of customer codes and those customer name, surname, age, location...
And I want to match and copy each of those customer codes in Table 1 all the information which is on Table2
Table 1:
50025
50026
50086
Table 2: Considering that name, age and location is each in separate cell
50025JohnSecond25Location 1
60085EmilyThird 20Location 2
45454Wilhelm Fourth35Location 3
10000RoseFifth 60Location 4
50086JohnySixth 45Location 5
65501JacobSeventh18Location 6
50026Jackie Eighth22Location 7
And the outcame should be that it finds the value from Table1 in Table2 and copy's information in Table 1 like this:
50025 JohnSecond25Location 1
50026 Jackie Eighth22Location 7
50086 Johny Sixth 45Location 5
View 2 Replies
View Related
Feb 20, 2014
I have two worksheet "ABX" and "ACX" from which I want to find the matching data for specific columns B, D and E only.
Matching data will be in sheet "Match" and vice versa.
Data are present dynamically.
View 1 Replies
View Related
Sep 4, 2013
I have two excel sheets with order details.
Sheet1:A1:Order ID, B1:City, C1:State
Sheet2:A1:Order ID, B1:Rate
Sheet 1 only contains successful order ID's In Sheet 2 there are many order ids with pending, failed, successful transactions.
I want to compare Sheet1:A1 with Sheet2 full range Order ID's. If there is a match it should copy B1:rate to Sheet1 D1 and so on. I tried some VLOOKUP formulas but they did not work.
View 4 Replies
View Related
Dec 21, 2013
I paste new data into a sheet of a monthly report I prepare. For this sheet, the # of data rows change (and is unpredictable) every month. I need the value inside a specific cell that dynamcially moves up and down based on the # of rows for that month (because it's below the rows of data).
So I made a formula to identify the exact cell # every month.
Example:
This month the exact cell is F255 in the "Refi" sheet.
So my formula in the "Summary" sheet cell A1 first finds the cell row # only (255) and since it's always column F, in B1 I have
VB:
="F" & (A1)
This outputs "F255" in B1, successfully identifying the target cell.
Now how do I write a formula in C1 to grab the value from whatever cell is named in B1. (For this month, the value in cell F255 from the "Refi" sheet)
View 7 Replies
View Related
Oct 11, 2013
I'm trying to match in the example, 'Name 1' which will pick the number below name 1. However if I have any space before, ' Name 1' in cell A1 than it won't match. I've put in wildcards in the formula but it still doesn't pick up the space? I need the formula to pick up either no spaces, or any number of spaces before or after 'Name 1'.
[Code] ......
I've attached an excel file showing the layout...
test_match.xlsx‎
View 3 Replies
View Related
Jun 16, 2009
formula below.
Crude and does not work.
I hope what I have said makes sense and can be written correctly.
'If WorksheetFunction.CountIf(Range("A:A"), Cells(i, 1).Value) > 1 Then
copy.Range("U:U"), Cells(i, 1).Value)=1
Cells(i, 21).Paste.Value.Count > 1
Basically, For Each Value in A that's identical. I need the value in "U" in the row for the first value in A to be copied down to the last row for the specific value in A.
View 12 Replies
View Related
Jun 17, 2009
I'm trying to grab data from two sheets by first doing a match. The match works, but how can I now reference ws2 so that I can pick up data if this match is true?
View 2 Replies
View Related
Apr 18, 2013
I have some cells with text entered in column A.
These cells contain a time reference either in '09:30 - 16:30' format or just an 'AM/PM' format.
What I need to do is to populate column B with the part of the string that comes AFTER the times in the text (either in hh:mm format or AM/PM format)
Example
336 Data 2012 Classroom Induction 2012/08/28 09:30 - 16:30 data about this ------> data about this
336 Information about this 2013/04/04 09:00 - 13:00 Information 2 ------> Information 2
336 info CHS Suffolk 2013/05/07 PM DRC, BSE ------> DRC, BSE
364 information 2013/02/12 AM DRC, BSE ------> DRC, BSE
I cannot get this to work and cannot use Text To column as there is no character I can use to split it.
View 4 Replies
View Related
Dec 27, 2012
How to match one cell against multiple columns.
I have numbers in columns a through cc and cannot put them in descending order. I am using this formula:
=match(CF1,A10:A1008,0) I have to use a new cell and type the same formula =match(CF1,B10:B1008,0) then again =match(CF1,C10:C1008,0) I AM RUNNING OUT OF ROOM! Is there anyway to search all columns =match(CF1,A10:CC1008,0) ?? This formula doesn't work when I type it in.
I have tried shift control enter for an array and still no go.
I have tried vlookup
I have tried Index
I have tried Iferror
I have tried isna
View 2 Replies
View Related