How To Delete All Words Containing Specific Characters
May 14, 2014
I need a formula which can clean up a huge data set. Essentially i need to delete the entire word which contains the characters "aceae". note that "aceae" is a suffix, but i need to delete the entire word not just the suffix, plus keep the rest of the string. i have tried the "find and replace" function of excel with wildcard, but that deletes everything before/after without deleting the entire word. i have tried a combination of formulas to isolate the unwanted words, but that method is inefficient and inaccurate. below is a schematic of what im looking to do:
Column A ------------------------------ Column B
l. planeri asteraceae africa laselva-----> l. planeri africa laselva
l. planeri moraceae europe singer------> l. planeri europe singer
origin l. fluviatilis bignoniaceae asia----> origin l. fluviatilis asia
alternate l. fluviatilis piperaceae asia---> alternate l. fluviatilis asia
I have about 2000 rows, all with an amount of words between 2 and 6. I want to limit each row to keep only the first TWO words. Is there a way to do this?
If not, is there a way to limit each row to only keep the first 11 characters?
Currently I am using the Kickbutt VBA Find Function of Aaron, but I would like to have something that works more efficiently. What I currently do is (assuming all possible values for Column J are A - F):
although I just want some code that says: delete all rows except those that have "F" as content in Column J. I already tried something like:
Range("1:65536").Select For Each cl In Range("J:J") If cl.Text = "A" Or cl.Text = "B" Or cl.Text = "C" Or cl.Text = "D" Or cl.Text = "E" Then Rows(cl.Row).Delete End If Next
but it also takes much to long. The major problem I think, is that the number of records is variable so I search the entire worksheet...
how to create one macro: I have a spreadsheet with 8 columns with various text headings. Each column has different data (some show dates, some show only figures, some show text). Specifically, column E (entitled "Sub Item Reference") has various text entries (e.g. "Newsletter" or "Booklet"). I am hoping to find a simple macro that will search column E and delete any rows where that column contains the text "Cover" or "Label". I'm sure it's the simplest thing going but I can't seem to work it out.
I have one column with many numbers. Some have one dash and some have two.
Example: 123-123456-65 012-789546-1 98B12354-889
Is there a way that I can remove all characters after the last – (dash) in the number? Example:
If number is 123-123456-65 Then 123-123456
If number is 98B12354-889 Then 98B12354
If someone could just lead me in a direction, I might be able to figure it out. However, my code is elementary and most of the time, I record macros and the play with the code until it does what I want.
I want to sort on number of words, i.e. if a cell contains 1 or 2 words etc, with the cells containing 1 word coming first then cells containing 2 words. Also, if possible, first the cells with fewer characters.
I am trying to detete rows that have several specific values, upper and lower case, (A-H) in any of several columns (B through H). I can delete upper and lower case "D"s in column B, but I'm having difficulty stringing together several variations and getting at the "D"s that are midstream (such as: ADeC), I tried ("*D*") to no avail.
With . Cells(Lrow, "B") If Not IsError(.Value) Then '**** If LCase(.Value) = LCase("D") Then .EntireRow.Delete
i bought a tattslotto scratch card (for those of ya outside of australia, not sure what youd call em, basically lottery ticket/game), this game is essentially a crossword puzzle, you scratch your letters out in a box then you have a list of words, you need to find words that are made up entirely of your letters, the more words you find, the more you win ive kind of screwed up the card and scratched out words i dont have, however i do have atleast 2 words and i think ive got more, potentially could win big but wanna know how much before i go claim it
ive opened up a new workbook, in the A column ive got a list of all my words, then in C1 ive got a field where ive entered all my letters, wondering if theres a way to get excel to work it out for me (like an IF statement on the fields in column A to compare them to C1, or some kind of conditional formatting rule)
How do I change the Excel settings to display in each cell as many characters as fit within the allotted cell space?
To elaborate, in previous versions of Excel that I have used, when a cell contained more characters than could be displayed in the size allotted, for viewing and printing purposes, the cell would simply display (starting at the beginning) as many characters as possible. After upgrading, I have found that when a cell contains more characters than can be displayed, it simply displays the last word contained in the cell.
For example if a cell contains "Frederico Gonzalez & Jose Rodriquez", but there is not room to display the entirety of the message, I would like the cell to display "Frederico Gonzalez & Jo", but the way it is currently displaying is "Rodriquez " with a whole lot of empty space afterwards.
This causes a problem, because it is usually not evident that more information is contained in that cell (unless the cell is selected).
How do I change the Excel settings to display in each cell as many characters as fit within the allotted cell space?
I am suffering with split a long descriptions into 3 cells with criteria 1st cell not more than 30 characters, 2nd cell not more than characters and 3rd cell will locate the remaining characters there. I think this is quite easy if I use LEN/MID/RIGHT/LEFT formula. However, I wish the formula will smart enough to split word by word. refer to example below:-
"My lecturer replied, that i really did very bad in final, nothing's gonna change my plan."
If I use left(A1,30) formula, the result is "My lecturer replied, that i re"however, the word "really" is cut half way. I am finding the formula that split description to not more than 30 characters and won't cut my string and become incomplete word. Expected result should be 1st cell "My lecturer replied, that i", then "really did very bad in final," at 2nd cell.
I have excel document over 50 pages and i need to filter lines that begins with certain letters like ADS, SGH, FAQ. I know how to filter one by one but i need all 3 to filter in same time-
How can i make multiple lines to filter in one search?
I have 1000 diff names in a spread sheet and wish to search another spread sheet with these names on and alot more.
I want the search to look in the larger spread sheet for these 1000 names and copy all the informtaion in the cells to a new sheet, if the name is not found i would like something like "no info found" to be seen.
Im a novice to doing this sort of thing in excel, but i have found this script which searches for the word "mail box" and copies all the info in the cell when it finds it.
I have two sources of information that I need to look up on, but one of the sources contains other words within the same cell?
For Example I have a source of data which contains all our client names, and I need to search for the client name in a second source of data to bring through the value from another cell, however the table array that I would do the look up on contains both the client name and project name together in one cell - therefore I am unable to do a normal Vlookup - also the client name is not always the same number of letters.
See an example:
Source data 1: Client name: XYZ Ltd
Source data 2: in cell A1 XYZ Ltd/project ABC in cell A2 shows the value e.g.: £5000
Would there be anyway to do a look up on XYZ Ltd to bring through the value in A2 on source data 1?
Tim MacDonald Pat @ Justine Carey Penn Fishing C/O Denise Long Krista Dawkins Therese le Latshaw
I'm using =LEN(TRIM(C2))-LEN(SUBSTITUTE(C2," ",""))+1 to do a word count. What I need is a formula that will delete all characters between the first and last word if the word count equals more than 2. Even just a formula to determine the location of the first and last space so I can use MID() to cut it out.
Basically, I want a formula that searches for more than one word anywhere within a cell, and if the cell contains any of those words somewhere in it then I want to display a value, but if the words aren't there, then stay blank.
For example, my cell could say: "Magenta, Rose, Lime, Lavendar". I want to search this cell for any of the these words: "Lime", "Forest" or "Teal". If any of these appear, I then want the cell with this formula to say "Green".
I know the formula to search for only one word /phrase in a cell, I use: =(IF(ISNUMBER(SEARCH("yellow",A1)),"colour","-")), (i.e. if the word "yellow" appears anywhere in cell A1, then this cell will show the word "colour", if not then a "-".) I tried adding an 'OR' function in this to search multiple words but it didn't seem to work.
Above is the formula I'm trying to get to work but it's not-a-happenin. It seems like the first IF overides all of the others. Basically I want the first IF to be ignored if column G contains any of the words shown. So basically what I think is happening is that P3 is less than Q1 so it's ignoring the rest of the IFs. Originally my formula worked fine as:
=IF(P4<$Q$1,E4-S4,"Not Changed")
But I realized that i needed a certain category of product ignored. Products are labeled in column G.
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 am trying to extract numbers after a specific text in a text, for eg :
abc SN 12345 xyz edf SN No. 456 mno
As per above, i want to extract any numbers afters "SN". the numbers can be vary in digits i.e. it can be 3 digit numbers or 4 or 6. Also, at times there is some other text in between (like SN No.) numbers and search word (i.e. SN)
I have a column containing mixed text and I want to remove everything from the column except instances of certain colors; black, red, blue etc. Is there a formula which would do this or can it be done with Search/Replace?
Is there a way of counting how many rows have cells containing a specific word. Some rows will have multiple cells with the word in and some will have none. I only want a count of the number of rows and not the number of times the word appears. How can i acheive this with VBA?
I have sheet 1 with a list of numbers in column A and a list of text next to them in column B. I need the code to look at a list of words that will be in column A on sheet 2 and if any of those words appear anywhere within the cell (could be at the beginning, middle or end) in column B on sheet 1 then I need the entire row deleted.
I'm trying to build a function, but I haven't been able to successfully navigate some of the eccentricities of Excel formula-building.
Right now I am working on counting all of the cells that contain numbers (so likely just a =COUNT function), but will be eventually getting other descriptive stats as well. My problem is that I would like to create a formula that will perform the counting/mean calculation, etc., but only on a specific column that has the header cell that contains several specific words. Rather than having to type in the target words for each column, I would like to have the target words in the function be imported from multiple designated cells.
For example,
I want to find how many numbered cells are found in column E headed as "dog brown," but I also have columns headed as "cat brown" "dog black" etc. (which I will be using the formula on later) to paint a small picture, in my descriptive table, "dog" is in B31 and "brown" is in C30, then "cat" in B32 and "black" in D30.
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?")
i got a a sheet with over 10000 entries, problem is that it has been compiled by many people, each which has his or her own way of entering the data. Here is the problem i have a field in which they can enter a coordinate X,Y and a corresponding area. the sytaks is Area XXYY so it should look like this P20522. Where P2 is the Area and X=05 and Y=22.
most of the entries has the area in a different field and is written X5,Y22 but some is done correct some without the comma, further more i need to add the 0 in fron if it is a number below 10.