MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 1st, 2002, 06:43 AM   #1
Guest
 
Posts: n/a
Default

Hello
I have posted a question about sorting
I am wondering is it possible to sort a data with the following format (in excel)
Date..Time..Color..Freq
.2.....3......B.....C
..............A.....D
..............C.....P
Date..Time..Color..Freq
.3.....4......D.....A
..............D.....Q
..............O.....R

...means blank cells

so I can sort Date or Time and move the corrisponding data all together without changing the original format

Thanks in advance
  Reply With Quote
Old Mar 1st, 2002, 08:03 AM   #2
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

You could fill-in the blanks with the value from the cell above and then use conditional formatting to hide duplicate date and time values. So, using your data in cells A1:D7 after the removal of the duplicate column headers...

1. Select cells A1:B7 and choose the Edit | Go To... | Special... Blanks menu command.

2. Without altering the selection Control+Enter the formula, =A2, into cell A3.

3. Select columns A:B and press [ Tab ] until cell A2 is the active cell.

4. Choose the Format | Conditional Formatting ... menu command.

5. Setup a "Formula Is" condition using the formula, =A1=A2, and format the Font color to match the cell background color (white, in my case).

Now you should be able to sort on the values in columns A:B and still preserve the appearance of your data.

[ This Message was edited by: Mark W. on 2002-03-01 07:04 ]
Mark W. is offline   Reply With Quote
Old Mar 1st, 2002, 08:45 AM   #3
Guest
 
Posts: n/a
Default

Hi Mark
I am not sure if I get your solution
.A.....B.....C......D
1Date..Time..Color..Freq
2.2.....3......B.....C
3..............A.....D
4..............C.....P
5Date..Time..Color..Freq
6.3.....4......D.....A
7..............D.....Q
8..............O.....R

...means blank cells

So right now I have columns A~D rows 1~8


1. Select cells A1:B7 and choose the Edit | Go To... | Special... Blanks menu command.

-->After I done this step, I selected all the blank cells in columns A~B(I selected A1:B8 becasue I have 8 rows)

2. Without altering the selection Control+Enter the formula, =A2, into cell A3.

-->Now, I copied the value 2(from A2)to A3

3. Select columns A:B and press [ Tab ] until cell A2 is the active cell.

-->Then I selected Columns A:B with A2 actived

4. Choose the Format | Conditional Formatting ... menu command.

5. Setup a "Formula Is" condition using the formula, =A1=A2, and format the Font color to match the cell background color (white in my case).

-->Then I setup a "Formula Is" and type in =A2=A3(because A1 is my header). And click Ok
But nothing happens

Now you should be able to sort on the values in columns A:B and still preserve the appearance of your data.

-->Then I select all the data and press sort button. But the 2nd header(Date, Time..)can't move with the sorted data, and the appearance of the corresponding data are also sorted(can't preserve the appearance)

So, is there something I did incorrectly?

  Reply With Quote
Old Mar 1st, 2002, 09:09 AM   #4
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Sorry, I forgot Step 2.5...

...So, using your data in cells A1:D7
after the removal of the duplicate column headers...

1. Select cells A1:B7 and choose the Edit | Go To... | Special... Blanks menu command.

2. Without altering the selection Control+Enter the formula, =A2, into cell A3.

2.5 Select columns A:B and perform Copy/Paste Special... Values.

3. Select columns A:B and press [ Tab ] until cell A2 is the active cell.

4. Choose the Format | Conditional Formatting ... menu command.

5. Setup a "Formula Is" condition using the formula, =A1=A2, and format the Font color to match the cell background color (white, in my case).

Now you should be able to sort on the values in columns A:B and still preserve the appearance of your data.

Follow these instructions exactly as listed... Don't alter any of these formulas and don't fail to remove the duplicate header labels.

[ This Message was edited by: Mark W. on 2002-03-01 08:11 ]
Mark W. is offline   Reply With Quote
Old Mar 1st, 2002, 09:23 AM   #5
Guest
 
Posts: n/a
Default

Hi Mark
In the beginning you said , using your data in cells A1:D7 after the removal of the duplicate column headers...
Do you mean I have to delete all the header before I perform the steps 1~5?

Also, when I do step 2.5, it gives me an error message (That command cannot be used on multiple selection) after I press OK

I am not sure what does step2.5 do. It just copy the ColumnA and B and paste back to its original position



  Reply With Quote
Old Mar 1st, 2002, 09:40 AM   #6
Guest
 
Posts: n/a
Default

Hi Mark
I am just wondering when I successfuly sort the data. Does it only sort the columns A and B? I am trying to do is that to sort either column A or B and move the other columns together. For example

Date Time something
33...44.....A
............B
............C
Date Time Something
22...33.....C
............D
............E
After I perform a Time sort, I can get somthing like

Date Time Something
22...33......C
.............D
.............E
Date Time Something
33....44.....A
.............B
.............C

So,22 33 CDE is one spec, 33 44 ABC is another spec

Thank you
  Reply With Quote
Old Mar 1st, 2002, 09:44 AM   #7
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

You should remove all but the 1st row of headers. Otherwise, they would be affected by the sort. You shouldn't need them any way.

If you truly selected columns A:B at step 2.5 you wouldn't have a multiple selection. Click on the column A heading and drag your selection to column B.

Step 2.5 preserves the values calculated at Step 2 so that the sort won't affect them.
Mark W. is offline   Reply With Quote
Old Mar 1st, 2002, 10:13 AM   #8
Guest
 
Posts: n/a
Default

When I sort should I also select column C and D? I am trying to have the data in C and D move with the sorted value in column A and B.(Format shown on a couple of message box before)
After I finish steps 1~5. Then I select all the data form columns A~D and press sort button. The data are sort separately by each column and not just by one column. Also, the space in columns A and B are all move to the buttom(no preserved space) Why???
  Reply With Quote
Old Mar 1st, 2002, 11:49 AM   #9
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Quote:
On 2002-03-01 09:13, Anonymous wrote:
When I sort should I also select column C and D? I am trying to have the data in C and D move with the sorted value in column A and B.(Format shown on a couple of message box before)
After I finish steps 1~5. Then I select all the data form columns A~D and press sort button. The data are sort separately by each column and not just by one column. Also, the space in columns A and B are all move to the buttom(no preserved space) Why???
After performing the steps above there won't be any more empty cells in columns A and B -- only cells that appear empty, and ordering of those cells relative to one another should not be affected by the sort.

If you select any one cell in the range A1:D7 the sort will sort all columns in that range.
Mark W. is offline   Reply With Quote
Old Mar 1st, 2002, 12:16 PM   #10
Guest
 
Posts: n/a
Default

Hello Mark
I am trying to perform a sorting like the following:
Date Time something
33...44.....A
............B
............C
Date Time Something
22...33.....C
............D
............E
After I perform a Time sort, I can get somthing like

Date Time Something
22...33......C
.............D
.............E
Date Time Something
33....44.....A
.............B
.............C

Is it possible to keep all the blank cells(space) after sorting, and the data under column Something can match the sorted Date and Time?
I can't sort the data under Somthing column, but I must move those data to match their corresponding Date and Time data.

I tried the 5 steps(I hope I did them correctly) but I still can't achieve the sort above

What should I do???
  Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 02:34 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes