Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Jack P
Lv 5
Jack P asked in Computers & InternetSoftware · 9 years ago

Ultimate Excel Logic formulas Challenge?

I have a products CSV export I'm working on.

Each product goes to many, many categories. And there are 4 tiers of categories. My "category" column entries look like this:

"Ford/Ranger/2011/2.3L 140Cu. In. l4 GAS DOHC NA;Ford/Ranger/2010/2.3L 140Cu. In. l4 GAS DOHC NA;Ford/Ranger/2009/2.3L 140Cu. In. l4 GAS DOHC NA;Mazda/B2300/2009/2.3L 2300CC l4 GAS DOHC NA;Ford/Ranger/2008/2.3L 140Cu. In. l4 GAS DOHC NA;Mazda/B2300/2008/2.3L 2300CC l4 GAS DOHC NA;Ford/Ranger/2007/3.0L 182Cu. In. V6 GAS OHV NA;Ford/Ranger/2007/2.3L 140Cu. In. l4 GAS DOHC NA;Mazda/B2300/2007/2.3L 2300CC l4 GAS DOHC NA;Mazda/B3000/2007/3.0L 2954CC V6 GAS OHV NA;Ford/Ranger/2006/3.0L 182Cu. In. V6 GAS OHV NA;Ford/Ranger/2006/2.3L 140Cu. In. l4 GAS DOHC NA;Mazda/B2300/2006/2.3L 2300CC l4 GAS DOHC NA;Mazda/B3000/2006/3.0L 2954CC V6 GAS OHV NA;Ford/Ranger/2005/3.0L 182Cu. In. V6 GAS OHV NA;Ford/Ranger/2005/2.3L 140Cu. In. l4 GAS DOHC NA;Mazda/B2300/2005/2.3L 2300CC l4 GAS DOHC NA;Mazda/B3000/2005/3.0L 2954CC V6 GAS OHV NA;Ford/Ranger/2004/3.0L 182Cu. In. V6 FLEX OHV NA"

Category tiers are separated by slashes("/") and category entries are separated by semicolons (";")

What I need is I need to alphabetize the entries.

Step 1: Text to Columns by the semicolon to separate the category entries.

Step 2: There are 3 options a) Copy and Paste to transpose and create a macro to sort alphabetically through every column independently of the other columns. But I don't know the VBA code to get the itiration right. 2) Make a long logical formula using the comparison operators < and >. It would have to be quite long. Some products have up to 20 category entries. 3) Something else I haven't thought of.

2 Answers

Relevance
  • 9 years ago
    Favorite Answer

    Copy your data and paste into Word.

    On the Home tab, click on Replace.

    In the Replace What field enter the ; (semicolon)

    In the Replace With field enter ^p This will replace the semicolon with a paragraph mark.

    Copy the result and paste into Excel.

    Select the column where you pasted the data.

    Click on the Data tab, click on Text to Columns

    Select Delimited and choose Other and enter /

    Click Finish.

    Select all your data.

    Click on the Data tab and then click on the sort button.

    I had entered the data into column A to start so my sorts were:

    Column A.......A to Z

    Column B.......A to Z

    Column C.......Largest to Smallest.

    You can also sort on the engine displacement but I didn't go that far.

    The result is:

    Ford Ranger 2011 2.3L 140Cu. In. l4 GAS DOHC NA

    Ford Ranger 2010 2.3L 140Cu. In. l4 GAS DOHC NA

    Ford Ranger 2009 2.3L 140Cu. In. l4 GAS DOHC NA

    Ford Ranger 2008 2.3L 140Cu. In. l4 GAS DOHC NA

    Ford Ranger 2007 3.0L 182Cu. In. V6 GAS OHV NA

    Ford Ranger 2007 2.3L 140Cu. In. l4 GAS DOHC NA

    Ford Ranger 2006 3.0L 182Cu. In. V6 GAS OHV NA

    Ford Ranger 2006 2.3L 140Cu. In. l4 GAS DOHC NA

    Ford Ranger 2005 3.0L 182Cu. In. V6 GAS OHV NA

    Ford Ranger 2005 2.3L 140Cu. In. l4 GAS DOHC NA

    Ford Ranger 2004 3.0L 182Cu. In. V6 FLEX OHV NA

    Mazda B2300 2009 2.3L 2300CC l4 GAS DOHC NA

    Mazda B2300 2008 2.3L 2300CC l4 GAS DOHC NA

    Mazda B2300 2007 2.3L 2300CC l4 GAS DOHC NA

    Mazda B2300 2006 2.3L 2300CC l4 GAS DOHC NA

    Mazda B2300 2005 2.3L 2300CC l4 GAS DOHC NA

    Mazda B3000 2007 3.0L 2954CC V6 GAS OHV NA

    Mazda B3000 2006 3.0L 2954CC V6 GAS OHV NA

    Mazda B3000 2005 3.0L 2954CC V6 GAS OHV NA

    Source(s): Experience.
  • ?
    Lv 4
    5 years ago

    no longer straightforward. right it rather is form of interior the order I appeared at it. no less than, that is interior the order I wrote the solutions. 7) B 3) B 6) C 8) D 9) D 4) D a million) D 2) B 10) A 5) B Rewritten in numerical order: a million) D 2) B 3) B 4) D 5) B 6) C 7) B 8) D 9) D 10) A EDIT: How I arrived at my answer... "i can't supply tricks, so do no longer ask. If questions look ambiguous and undecidable, forget with regard to the surely solutions - assume that each answer has a hidden "correctness" fee, which ought to coincide with the different questions and solutions. Deductively, there'll exist one unique answer that could be marked as "superb"." sufficiently large hint there. 5) and 10) are ambiguous. because of this, I immediately understand i ought to deduce the solutions. 7) is B with a view to chop back the possible options of five). If 7) is B, 3) is B. No large subject there. If 3) isn't C or D, then the two 6) and eight) must be C or D. there is in simple terms one superb answer. as a result, I then appeared at 6). 6) is a great one. If D is fake, then 8) is B and a million) is B. regardless of the undeniable fact that, if a million) is B, then 8) is A. that is impossible to have 2 superb solutions, as a result C is fake. 8) can not be C, as a result it may be D. 3 is a triangular type isn't it? properly, that is why 9) is D. 6) isn't B, as a result 4) is D. If 4) is D, then it is not A nor C. as a result a million) is D. If A is the answer to 2), then a million + the type of solutions with letter answer A is 3. regardless of the undeniable fact that, 3 is a triangular type. 8 already has the respond D. There can not be 2 solutions as a result, 2) isn't A. i've got already spoke back a great number of the questions, as a result 2) isn't D. 2) can in simple terms be B. Now, undergo in ideas that no question has 2 solutions. as a result, the type of questions approximately attempt with B or C can not be 3. as a result, one in each of five) and 10) must be A and the different must be B. 10) can not be B. Why? verify out 7), 7) is B. If 10) is B, 7) has 2 solutions. 10) is A and 5) is B. EDIT: Drat... What a sadness. I in simple terms observed "a) The type of a question with the respond B" does not say "a) The type of questions approximately this attempt with answer B". thank you for the thumbs up human beings, yet that is rather not the excellent answer... 3) can not be B.

Still have questions? Get your answers by asking now.