Sort and exclude certain words

Hi ...

I work in a public library and frequently export lists of books from
our online catalog to Excel, so that I can manipulate the data in
various ways.

My problem in sorting in Excel is this:  Our library catalog excludes
words like "The" "A" or "An" at the beginning of a title when sorting. 
Excel, however, does not.

Is there any way I can sort on a field in Excel and have it ignore
certain words at the beginning of a string?

Thanks!


-- 
jds217
------------------------------------------------------------------------
jds217's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=28608
View this thread: http://www.excelforum.com/showthread.php?threadid=482709

0
11/7/2005 3:57:40 AM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
852 Views

Similar Articles

[PageSpeed] 12

One way:

If your data is in column A starting in row 2 then in any unused column 
in row 2 enter the formula:
=IF(LEFT(A2,4)="The ",MID(A2,5,256),
IF(LEFT(A2,2)="A ",MID(A2,3,256),
IF(LEFT(A2,3)="An ",MID(A2,4,256),A2)))

Copy this down as far as needed and then select all your data and sort 
on this new column.

Hope this helps
Rowan

jds217 wrote:
> Hi ...
> 
> I work in a public library and frequently export lists of books from
> our online catalog to Excel, so that I can manipulate the data in
> various ways.
> 
> My problem in sorting in Excel is this:  Our library catalog excludes
> words like "The" "A" or "An" at the beginning of a title when sorting. 
> Excel, however, does not.
> 
> Is there any way I can sort on a field in Excel and have it ignore
> certain words at the beginning of a string?
> 
> Thanks!
> 
> 
0
11/7/2005 4:19:17 AM
On Sun, 6 Nov 2005 21:57:40 -0600, jds217
<jds217.1y3yty_1131336001.6988@excelforum-nospam.com> wrote:

>
>Hi ...
>
>I work in a public library and frequently export lists of books from
>our online catalog to Excel, so that I can manipulate the data in
>various ways.
>
>My problem in sorting in Excel is this:  Our library catalog excludes
>words like "The" "A" or "An" at the beginning of a title when sorting. 
>Excel, however, does not.
>
>Is there any way I can sort on a field in Excel and have it ignore
>certain words at the beginning of a string?
>
>Thanks!

I wonder about your card catalog.  For example, is the book "A Tree Grows in
Brooklyn" cataloged under the "A's" or the "T's"?  (or both).

In any event, there are various methods, all of which involve constructing a
separate list that excludes the initial word, and sorting on this new list.

If there are just a few words to be excluded, and not much change in the list,
then a simple, nested IF function as recommended by Rowan will work just fine.

If there are a larger number of words, then a more general solution could be
had by using the following formula to construct your "word-stripped" list.

=IF(COUNTIF(ListOfWords,LEFT(A1,FIND(" ",A1)-1)),
TRIM(MID(A1,FIND(" ",A1)+1,255)),A1)

ListOfWords is a range where you have listed all of the first words which you
want excluded.  You may either NAME the range, or substitute the reference in
the formula (e.g. Z1:Z10)

VBA solutions are also available.


--ron
0
ronrosenfeld (3122)
11/7/2005 12:39:05 PM
Reply:

Similar Artilces:

Where's the Sort by New Message option?
Not sure when the layout of the newsgroups changed but I can't seem to find the ability to sort by new message in a thread instead of sorting by just the original thread date. That was hugely helpful as I could follow along and see what threads were still active. If you're gonna hang around in the newsgroups (any newsgroups), you may want to start using a newsreader. Microsoft Outlook Express can do it for you. Saved from a previous post: You may want to connect to the ms newsserver directly: If you have Outlook Express installed, try clicking on these links (or copy and paste i...

How to sort account list?
I'm using MS Money 2004 Small Business. In the account list, my accounts are catagorized by and in this order: - bank accounts - credit accounts - investment accounts - loans and liabilities - asset accounts TOTAL BALANCE In the above view, I cannot easily determine totals for assets and liabilities. The following view does this. - bank accounts - investment accounts - asset accounts SUBTOTAL -loans and liabilities SUBTOTAL TOTAL BALANCE How do I get the above view? Thanks, Brett I don't use Small Business. But you can run a Net Worth report to get total assets and ...

Sorting
Hi, is it possible to use variable for sorting? Something like: declare @sort varchar(10) SET @sort='column1 DESC' SELECT ROW_NUMBER() OVER (ORDER BY @sort)AS rowId, * FROM table Is dynamic SQL only option? Thank you, Simon On 15/04/2010 11:28, simon wrote: > Hi, > > is it possible to use variable for sorting? > > Something like: > > declare @sort varchar(10) > SET @sort='column1 DESC' > > SELECT ROW_NUMBER() OVER (ORDER BY @sort)AS rowId, * FROM table > > Is dynamic SQL only option? You can use CASE to he...

Row names will not move with sort
Each row in my summary table in Sheet1 is hyperlinked to a corresponding table in Sheet2 with additional details. I need to move the rows in my summary table (Sheet1) and preserve the links to and from the details tables (Sheet2). I found that I can move rows in Sheet1 with cut & insert and the hyperlinks are maintained. I can travel from a row in summary table (Sheet1) to details table (Sheet2) and back, even after the corresponding row (Sheet1) was moved. But if I sort the rows in Sheet1 the links from Sheet2 back to corresponding rows in Sheet1 lead to presorted locations. Apparen...

How to prevent ole container hwnd receive certain messages? #2
I used CSubclassWnd of Paul DiLascia to subclass(in fact use SetWindowLong to replace WindowProc) hwnd returned from IOleWindow::GetWindow. In the WindowProc I prevent it by LRESULT CShellEmbedding::WindowProc(UINT msg, WPARAM wp, LPARAM lp) { if (msg == WM_WINDOWPOSCHANGING) return 0; return CSubclassWnd::WindowProc(msg, wp, lp); // Important!! } but spy++ still tell me that hwnd of ole get the send WM_WINDOWPOSCHANGING message and return. So Is it right way to eat message in win32 or ole container hwnd does special things? "Su Wei" <suwei@sina_com> wrote in message new...

2pg per sheet in word
Hello: I'm using microsoft office v.X on my G4 powermac. My question is this.......in a Word document how can I set it to print "2 pages per sheet." My secretary has this option on her windows version of Word.....I'm starting to fear that I'm out of luck on my mac version. Help??? Tim Manwell tmanwell@yahoo.com In article <1161627359.523379.144860@i3g2000cwc.googlegroups.com>, tmanwell@yahoo.com wrote: > Hello: > > I'm using microsoft office v.X on my G4 powermac. > > My question is this.......in a Word document how can I set it to prin...

sorts not sorting
OK- Thanks to everyones help I now i have a list i can work with... but there are a few problems.... the zips are all 5 digit and now i have to sort them... the problem is, THEY WONT SORT CORRECTLY!!!!!!! The numbers are not in order... some are but a lot are not... is there anyway to fix this???? i need to sort them by zip code but cant seem to get them to do it correctly.. any ideas??? ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ You are going to be far better of...

import- number- sort?
I imported this data into a spread sheet- I tried to format it to number, but when I sort it- I get : 37.08 4.33 4.79 4.8 42.56 5.94 Whats up with this? Thanks Brent Hi Brent, Install the TrimAll macro, select the column and invoke the macro from Alt+F8 http://www.mvps.org/dmcritchie/excel/join.htm#trimall Directions to install and use a macro at http://www.mvps.org/dmcritchie/excel/getstarted.htm#havemacro I expect that you have spaces or CHAR(128) "Required Blank" characters in you data you can check is =LEN(A1) --- HTH, David...

sorting macro #3
I need to sort on 8 cells in a row and on 1500+rows. I can do it one at a time but I know there must be an easier way. Can ANYONE HELP? C3:J3 I need these cells sorted and then down to C1532:J1532 I did create a macro to sort after I selected them but still one at a time. Does it have to be a macro? I can edit a macro but don't really know how to program them. Yes, it has to be a macro. The following should do it. This macro loops through all the entries in Column C, and in each row it sorts the values in Columns C:J. HTH Otto Sub SortRows() Dim rColC As Range Dim i As...

export from Publisher to Word for editing
How do I create text frames that autoflow? Or, how do I change a text frame to one that flows? jaylarha <jaylarha@discussions.microsoft.com> was very recently heard to utter: > How do I create text frames that autoflow? Or, how do I change a text > frame to one that flows? I'm not sure what you mean by your question, when compared to your subject line. Are you using the Edit Story in Microsoft Word functionality? Are you trying to export your publication to Word format? If so, why? To create linked text boxes, use the chain link tool that appears when you have a text b...

starting Word from an Excel macro
I found this piece of code by Bob Phillips that opens a Word document from within an Excel macro. Dim oWord as Object Dim oDoc as Object Set oWord = CreateObject("Word.Application") oWord.Visible = True Set oDoc = oWord.Documents.Open("C:\personal\bob\personal\CV - RP (short).doc") It works fine but it also closes the Excel file that contains the macro. Is there a way to prevent the Excel file from closing? -- russ Russ, There's nothing in that snippet that will close the Excel Application. I think you need to post all yo...

Is the bug "Word does not remember position of window" still not fixed?
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel It looks like I've got this problem and in searching this board I notice that its described as a known bug in 2008. <br><br>Can it be that after two years and so many upgrades that Microsoft still has not fixed this? <br><br>OK, its not a huge deal, but I would be most grateful if someone would recommend a work around. The condition "still exists". But it's not a *Microsoft* bug :-) To be a bug according to Microsoft, they would have needed to DESIGN Word to remem...

Can we sort a form and also be able to enter new records.
Hi, It is possible to sort the data on a form and also be able to enter new and edit the existing records in it. Cheers! On Tue, 15 Jan 2008 15:41:16 -0800 (PST), Rex wrote: > Hi, > > It is possible to sort the data on a form and also be able to enter > new and edit the existing records in it. > > Cheers! I assume you mean "Is it". The form sort order has nothing to do with editing or adding new records, so the answer is yes. If you cannot edit or add new records, make sure the form's record source, if it is a query, is updateable. Some queries are not. O...

Sorting checking register
How do i sort my check register in Money 2004 Deluxe so that uncleared transactions appear below cleared transactions? In Quicken i could click on the column to provide that sort. In microsoft.public.money, Dean wrote: >How do i sort my check register in Money 2004 Deluxe so >that uncleared transactions appear below cleared >transactions? In Quicken i could click on the column to >provide that sort. You don't. Available choices are chosen by clicking View at the top of the register. ...

using addrress books to sort incoming mail
I use address books to sort incoming mail. An odd thing: depending on how the sender's name comes across, it doesn't get caught by the filter (amd moved to the "Family Mail" Folder I have set up. for example: my mom and dad's email (from momanddad@somedomain.com) comes as from that address. However, in my contacts, they are listed by their names: John and Mary Smith, with momanddad@somedomain.com as their email address and John and Mary Smith as the display name. What have I done wrong? TIA 1. The big ONE - failed to post your version of Outlook. Rules operate at ...

Unmerge so I can sort
I coy/pasted data into Excell and when I try to sort it I get "This operation requires merged sells to be identically sized". I understadn the work around in KB but how do I find which sells are merged? I wouldn't bother looking. I'd just remove all the merged cells from the range to sort. Select that range format|cells|alignment tab uncheck the merge cells box But if you wanted to search, you can do it via process of elimination. Select a range, format|cells|alignment tab. If that merge cells box is checked, then the whole selection is merged. If it's grey, t...

Copying chart as a picture into a table in word as a definite size
I've created a table (1*1) in word and I want to insert a graph fro excel as a picture into it. I know how to copy the graph as a picture, by holding Shift & pressin edit_copy picture. By drawing a rectangle in the table for the size want the graph to be and cutting/pasting into excel I resized the grap to the same size of the rectangle. deleted the rectangle and assume when I copied the graph into the table that it would be the right siz but every time I copy it and paste special into the table it does'n seem to be the right size. Any idea -- num ----------------------...

Word 2002: Textbox Fixed width and autosize height
Hi. Is there a way to set an ActiveX textbox control to have a fixed width but an autosized height? When I set the textbox autosize and multiline properties to true, the behavior is not quite what I want. On testing it, if I enter the textbox and exit without typing anything, it shrinks to the width of a single character. When re-entering the textbox and typing something, it puts in one letter per line. I tried setting the width in code, but although it will set the width initially, the same behavior occurs as described above. Any suggestions? -- Jinjer ...

sorting issue
Hi, When a range of columns are highlighted and a sort is performed on only one column empty cells above the sort display first. How can this be prevented. I know when there is data in any of the other column but not on the column being sorted this will happen. Any thoughts? Pat Are you sure the cells are really empty? They don't contain spaces or even formulas that evaluate to "". (Even formulas converted to values that returned "")? Pat wrote: > > Hi, > > When a range of columns are highlighted and a sort is performed on only one > column em...

Total certain records
One more question and I think I will have my report ( and my first project in Access ) nearly completed. This is in the same report I had just previously asked about, its full form is Customer Product Lbs purch $ purch cost info..... Acme 1AA $/lb info from here on Acme 1BB subtotals Acme 2AA Acme 2BB subtotals totals returns variances net(totals less returns +/- variances) We have several plants and hundreds of customers and products, the first letter of the p...

Word MailMerge and Outlook Security
We have a Word VBA macro that sends e-mails using the ActiveDocument.MailMerge object. When we execute the ActiveDocument.MailMerge.Execute method Outlook pops up the "An application is trying to access your address book..." message on a system using Outlook 2003 and Exchange 2003 (I believe). We had this issue before and were able to give our customers a workaround suggested by Microsoft. The work around was to use the Outlook Security template and customize the security settings for particular users. This worked in previous versions of Outlook/Exchange, but we are having some ...

Sort not sorting all rows
I'm using Excel 2000. have created a document, uploaded it to google docs and spreadsheets, exported it as a doc, converted it to a spreadsheet (excel) and uploaded it again to google docs. It's not a complicated file - no calculations or anything, just a simple log to enable us to collaborate on change requests and website faults. New requests are assigned a number incrementally one higher than the previous. So we need to sort on the Log number column to see what the last logged number was. However, it sorts most of the spreadsheet and leaves the same 5 rows unsorted at the...

Sort date by day and not year
Need to sort birthdates by month and day; ignore year. Ex: Would like to sort like list below: 3/02/1997 3/15/2002 3/21/1996 Not like this: 3/21/1996 3/02/1997 3/15/2002 Please help and thank you for your help. Kathy Hi one way: - add an additional helper column (lets ay B) - insert the following formula in B1 (if column A stores your list): =MONTH(A1) - copy this formula for all rows - sort with this helper column -- Regards Frank Kabel Frankfurt, Germany Kathy wrote: > Need to sort birthdates by month and day; ignore year. > > Ex: > Would like to sort like list below: >...

Sort and exclude certain words
Hi ... I work in a public library and frequently export lists of books from our online catalog to Excel, so that I can manipulate the data in various ways. My problem in sorting in Excel is this: Our library catalog excludes words like "The" "A" or "An" at the beginning of a title when sorting. Excel, however, does not. Is there any way I can sort on a field in Excel and have it ignore certain words at the beginning of a string? Thanks! -- jds217 ------------------------------------------------------------------------ jds217's Profile: http://www.exc...

Word turnign off Tracking Changes
Is there a GPO that can make Word to never offer or track changes to the documents? Thanks ...