I'm trying to write UDF which getting RegEx pattern and a certain cell as arguments and returns only matching string. For examples for string "The quick brown fox jumps over the lazy dog", and RegEx pattern "w{4}" the function will return two words "OVER" and "LAZY". What should I change in my code?
Function GetPattern(myPattern As String, myString As String)
Dim regEx As RegExp
Dim Matches As Object
Set regEx = CreateObject("VBScript.RegExp")
With regEx
.Pattern = myPattern
.IgnoreCase = True
End With
GetPattern = regEx.Replace(myString, "$1")
End Function
I would like to sync cells together that contain common words for sorting purposes is this possible? For instance i have a [URL] ..... in column A row 1 and In column B row 2 i have the word bellmont i need to get the rows to sync so rows containing common words line up. I have 8,000 rows to sync?
I have a spreadsheet of part #'s, descriptions, manufacturer names, and manufacturer part #'s. (It's a list of the inventory in my warehouse). Each row contains information for just the item in that row. Row 2 references another part in my warehouse, row 3 yet another, and so on.
Many of the parts have more than one potential manufacturer and part #, (meaning that any of those manufacturer's part #'s are basically the same tool; just different brands. At one time we may get a shipment of one, at other times we may get a shipment of another). For example, a screwdriver may be listed like this:
Part # 1234 screwdriver, mfg Snap-On, part # 456, mfg Stanley, part # 789, mfg Mac Tool, part # 439.
Then further down the list, there may be another part listed like this:
Part # 9980 wrench, mfg Stanley, part #741, mfg Snap-On, part # 852, mfg Proto, part # 369.
If you can imagine that data across the cells of a spreadsheet row, notice how the mfg name 'Snap-On' was the first mfg name on the screwdriver, but it was listed as the 2nd mfg name on the wrench.
So, here's my question: I want to be able to group all of the items made by any one manufacturer together in a new list. If all of the manufacturer names were in the same column, I could simply sort the list by that column, but since I've got thousands of rows with the mfg name I'm looking for in different columns on different rows, I thought maybe a macro could search each row for the word I'm looking for, then if found, take the whole row and copy it to a new worksheet. So the end result would be, If I wanted to see all items of which Snap-On is an acceptable supplier, I could get a list of all potential Snap-On items grouped together.
I'm sorry this is so long. I may have over-worded this and it may not be too clear. I could email an example of the spreadsheet if anyone needed more info to figure out what I'm looking for and was willing to take a look at it.
I have a spreadsheet with approx 7000 rows, many of which contain the same item but with flavors and other variations on the end. An example would be:
VB: A B 10142 6kg of whey bundle With Free protein shaker-Banana 10143 6kg of whey bundle With Free protein shaker-Chocolate 10144 6kg of whey bundle With Free protein shaker-Strawberry 10145 6kg of whey bundle With Free protein shaker-Unflavoured 10010 **Bodybuilding Warehouse Premium Whey Probiotic - 2.2kg 10011 **Bodybuilding Warehouse Premium Whey Probiotic - 2.2kg + FREE Shaker
Would it be possible To create a New column (column C) which would display all common words from row b into the New column Like below?
A B C 10142 6kg of whey bundle With Free protein shaker-Banana 6kg of whey bundle With Free protein shaker 10143 6kg of whey bundle With Free protein shaker-Chocolate 6kg of whey bundle With Free protein shaker 10144 6kg of whey bundle With Free protein shaker-Strawberry 6kg of whey bundle With Free protein shaker
[Code] ....
I've attached a larger sample of our list to get a better idea of different variations that are on the spreadsheet.
I think what we need is something similar to this thread[URL] .....
I've been racking my brains trying to find a way of doing this. I have a list (column A in Excel) of over 50,000 organisations and I'd like to know what the most common words used in the names are. Ideally it would great if I could produce a top 10 list of the most common words at the top e.g. Ltd, School or Church with a count in the next column of how times that word it appears
2. Once the entire list is broken down into its many parts, use the pivot table feature of excel to determine how common each of the parts is within the entire data set.
So, my questions are these:
1. Do you believe this is the best way to solve my problem? If not, what would be the preferred method? 2. If this is the best method, what function or script would I use to accomplish the first step of breaking down the lines into their individual parts?
Mike Auto Merged Post Until 24 Hrs Passes;It appears I put too many characters in the title of my post. It should read: Common Words - Decomposing Text Phrases
I want to have a few words shown based on figures in specific cells. I not quite sure how to explain, but i will try my best:
A1 = 5 A2 = 0 A3 = 7
The function i am using looks something like this:-
=IF(A1<6,"Do I Have Sickness Self Cert?","Do I Have Doctor's Paper?")
However, by using this function, if the cell is empty it still shows the first wording when i need it to show lets say between 1 & 6 shows the first wording and more than 6 shows the second wording! If you know what i mean... I know what i want to do but cant really explain it very well.
Maybe it should look something like this but it does not work the way i am doing it.
=IF(E156>1<6,"Do I Have Sickness Self Cert?","Do I Have Doctor's Paper?")
My main report (Report 1) has part number, serial number, and work order information, among other things I need. Report 2 contains this information as well, but also has a work order item number, which is needed in Report 1. Otherwise, Report 2 has nothing else of interest.
What functions will allow me to get the item number information I want from Report 2 into Report 1?
I have spent a lot of time trying various combinations of VLOOKUP, SUMPRODUCT, IF, etc with no luck. There is probably a very simple (I hope!) thing that I am overlooking.
I have two worksheets containing four columns of data, example below. I need to match data found in any one of the four columns in worksheet B, against the data in the corresponding column of worksheet A, and if matched, return the result from the “Asset No” column of worksheet A (and return N/A or similar if none of the four columns could be matched)
Worksheet A Asset Serial Server IP No. 1234511111ABCABCBlank. 45678Blank.DEFDEF12345 7891033333Blank...45678
Worksheet B Asset Serial Server IP No. Blank.22222XYZXYZBlank. 45678Blank.Blank...12345 Blank.Blank.Blank...45678
In this example, I would expect to return the result 45678 against row 2, & 78910 against row 3, and receive a “not found” in row 1
I tried using IF & OR in an array formula, but could only get to a TRUE or FALSE result (was not able to reference the Asset Number).
I have a different worksheet in the same workbook for every "gig" that I book. Each gig contains the name of the musicians I staffed on the gig along with their salary+expenses For taxes, I need to summarize into a new worksheet how much each musician made. Ideally i'd see not only the total per name but itemized. So if 1 guy did 3 diff gigs, I'd see each row pertaining to his name.
Lastly, I'd like to include names that do not have multiple records because it's possible there is inconsistencies with the spelling of certain names.
I need help on using the If function. Basically I am trying to calculate the cost of shipments. For example, cost of sending 1 box is 150 (eg cell A3), 2 boxes is 280 (cell A4), 3 boxes is 400 (A5), 4 boxes is 500, etc upto to 10 boxes (cell A12).
What I am looking for is cell A1 to provide me the cost based on the manually entered value of cell A2, i.e. if I enter a number between 1 to 10 in cell A2, then A1 should return a number from A3 to A12, e.g. enter 3 in A2 then A1 should return 400.
Is there such a formula or do I have to enter manually the amounts into an If function?
I've got an If statement in Excel which features several VLookups - I need the IF statement to return differing results to 2 different cells, is this possible?
In plain English, I'm looking for something like
If(Vlookup(A2, B2:D5, 4, False), C6="y" And D7="ok", "False")
Really basic question - I'm trying to get HLOOKUP to lookup a number and return text that is in another cell but it keeps returning #N/A. I know the formula works because when I change the text (that I want returned) into a number it returns the figure. How can I get round this?
Assume you have a rectangular range. Say A1:M18. There are values in some random cells (any number of cells) within the range. The rest of cells are blank. In cell M19 (ie cell below the bottom right corner of the range), I need a excel function that returns the nearest (ie physical location) non blank cell value. I have searched the internet for weeks. The closest formula is the following (see below) but it is flawed as it returns zero if there are values in rows below the row of the nearest cell with non blank...and also zero if there is value in a column greater than the column of the nearest cell with non blank.
Closest formula so far: INDEX(A1:M18,LARGE(IF(ISBLANK(A1:M18),"",ROW(A1:M18)),1)-ROW(A1:M18)+1,LARGE(IF(ISBLANK(A1:M18),"",COLUMN(A1:M18)),1)-COLUMN(A1:M18)+1).
And the function should be relative not absolute as the range can be extended..but the location of the formula remain same relative to the array size. (ie. always at below the right bottom cell).
NOTE: Ignore the special case where two non blank cells are the nearest. That will not happen.
I am in need of a forumula. I am trying to extract one word before a keyword, one word after a keyword, 2 words before a keyword, and 2 words after a keyword.
For example:
The keyword is blue:
birds are blue today - 1 word before=are; 1 word after=today; 2 words before=birds are; 2 words after=today
blue is my favorite color - 1 word before=(null); 1 word after=is; 2 words before=(null); 2 words after=is my
see blue colors in the sky - 1 word before=see; 1 word after=colors; 2 words before=see; 2 words after=colors in
I have a column of repeating names with ids (column A) and money they earned (column b) and would like to output a sum for each name (which is the first two words of every cell) for the total amount of individual earned money.
I'm trying to return only the following portion of the text from a large list.
So, I want to have just the following phrase appear in a column:
Original AAM UNIT AAM HIGH 50 DIVIDEND 13 $77,666,423 $1,132,491
To AAM HIGH 50 DIVIDEND
Original AAM UNIT AAM HIGH 50 DIVIDEND 13 $77,666,423 $1,132,491
To AAM HIGH 50 DIVIDEND
Original FIRST TRUST UNIT FT HIGH DIV EQUITY 15 $13,140,862 $301,295
To FT HIGH DIV EQUITY
So, I essentially, want any words that appear between "Unit" and the first number that appears before the $ sign (in this case 13 and 15 respectively, but the numbers can be anything - "Unit" stays the same down the list).
I have a spreadsheet that lists two columns - impressions and clicks - by date. Sometimes the same date is listed in multiple rows. What I would like to do is add the columns so that I have a total number of impressions and a total number of clicks by each date.
For example my data could look like: Date || Impressions || Clicks 01/01/09 || 5 || 6 01/01/09 || 3 || 4 01/01/09 || 4 || 7
and I would like it to look like this: Date || Impressions || Clicks 01/01/09 || 12 || 17
A shortened spreadsheet is attached. The actual one is for the past year with over 1000 rows, which is why I'm hoping someone can point me in an easy direction to do the summing.
I am using the extract words function outline here [url]
I copied and pasted the function into a new sub and deleted the sub module1 and the end sub to make sure it is it own function I can call. I have called it in another macro I wrote and when I run the macro it bugs out at the first if statement. The code it has a problem with the Get_Word code below. It throws a "Run-time error: '1004': unable to get the Find property of the WorksheetFunction class."...
Got something I need to do that I have never done.
I have a column on a worksheet1: NBC//1 ABC//1 ABC//2 ABC//3 ABC//4 CBS//1 CBS//2
I have a column on another worksheet2: NBC ABC CBS
In the column next to the above on worksheet2, i want to pull the numbers in for that (the numbers are contained in ONE column): NBC | 1 ABC | 1 2 3 4 CBS | 1 2
Im not sure how to go about this? In the example I attached, on sheet 2 column B, that is where I want the numbers to build to.
The compliment of a set is those elements not in the set. Excel doesn't do compliments well.
In Automatic Filter, one can easily see the rows that match criteria, but selecting the compliment of those rows (the ones that don't match the criteria) is difficult.
Similarly, there are the range functions Intersect and Union, but no Symetric Difference.
(Def: the symetric difference of two sets, AB, is the set of those elements in A that are not in B. {1,2,3,4,5}{2,3,4,10,11} = {1,5}.)
Other than by looping through cells:
Given two ranges, aRange and bRange, how would one code for those cells that are in aRange, but not in bRange.
I have 2 lists in column A and column B. For each cell in column B, I want to put a "YES" in the corresponding cell in column C if the contents (of the cell in column B) are somewhere in the entire list under column A (I think the list in both columns is about 5000+).
I have logged in after quite a gap and found that all my subscribed threads (gathered over a year) have vanished
I have an issue with VLOOKUP. By runnig VLOOup we can get the data that there is present in a specified range. But how about to get the data DISPLAYED which is not there in the specified range. I tried combining IF and VLOOKUP functions. I am on a simple project now and I would be happy if I could get the answer immeidately
I have two lists, one that is 99,000 lines and the other is 150. I am trying to find out where the word(s) in the list of 150 is present in the list 99,000.
1st list of 99,000 is in Sheet1 A1-A99000 and the second list is in Sheet2 B1-B150.
The caveat is that in column A there is additional words in that cell so you can not do a simple vlookup, because there may or may not be an exact match.
I have been stuck for hours and the best i can get is to use the match function but it is not working because it is not exact. Last thing i want to do is use the CTRL F key to lookup all the words.
Looking to find 1 of 2 words in a cell in column B and return the word found in the same row in column E. This seemed easy but I am not having any luck.
the cells in column B have several words in them but I am looking for 2 specific words "PLAT" and "ORIG". If the word is not in the cell, it should show a blank cell in column E in the same row, otherwise one of the 2 words should be in that row in column E. A VBA loop would be ideal but a formula that can do it might work as well.
What I'm trying to do is concatenate all of the URLs into one cell so that each email address has only 1 single row with many URLs associated with it. I tried using VLOOKUP(B1, $A$1:$B$4000, 1, FALSE) but this didn't work. I thought it was a long shot anyway. I also tried writing a bash script do parse a csv with this data and create a csv file with the URLs concatenated with no luck. I'm trying to get my data to look like this:
EDIT: The format didn't turn out like I'd hoped. In the first example, each URL has an associated email address, each in its own row. In the second, it is just one row, with multiple urls in the first cell and an email address in the second cell.
I've been working on a method to search a single column of 1000+ cells containing a paragraph with a 250+ word keyword list (also in a single column). I'm needing only complete words to be searched/ displayed regardless of spacing & punctuation. I've tried multiple methods the past few days and the one that worked (Macro with 4 complex formulas) was unusable when scaled out to all 1,000 rows due to the extremely long calculating time. I don't know VBA yet but was able to modify and create a user defined function that does everything I need except it displays string results that are not whole words (Ex. search for air, word in cell is fair, displays a result for air).
PHP Code:Â
Function RangeSearch2(text As String, wordlist As Range, seperator As String, Optional caseSensitive As Boolean = False)    Dim strMatches As String    Dim res As Variant    Dim arrWords() As String    Dim skip As Boolean    skip = False    On Error Resume Next    Err.Clear    For Each word In wordlist            If caseSensitive = False Then     Â