Sorting based on IF statement *please help me!*

Hi

I'm trying to create a macro which will sort a table 1st based on an
IF statement and then by a due date. What I'm trying to do is sort the
table so that any complete tasks (signalled by a "Yes" in the
designated column) will be pushed to the bottom of the list and the
most overdue to the top.

My IF statement displays a True or False in a hidden column if the
task is complete or not. Then I tried sorting by that column first and
then the due date afterwards. That didn't work either though because
the complete items are pushed right to the bottom of the sheet -
leaving hundreds of empty rows between!

I'm sure there must be an easier way. Can anyone help?

0
m.cringle (17)
9/18/2007 8:44:07 AM
excel 39879 articles. 2 followers. Follow

1 Replies
215 Views

Similar Articles

[PageSpeed] 4

Can't your macro just delete the blank rows?

It sounds as if you are allocating your hidden formula to many more
rows than you need, and the blank rows are indicating that the task
has not been completed. You could refine the formula so that it does
not respond to blank rows, or you could ensure that it only applies to
rows with data in them, or you could adjust your sort range to ensure
that only rows with data in are included.

So many possibilities !! It would help if you pasted your macro here.

Pete

On Sep 18, 9:44 am, Mikey C <m.crin...@gmail.com> wrote:
> Hi
>
> I'm trying to create a macro which will sort a table 1st based on an
> IF statement and then by a due date. What I'm trying to do is sort the
> table so that any complete tasks (signalled by a "Yes" in the
> designated column) will be pushed to the bottom of the list and the
> most overdue to the top.
>
> My IF statement displays a True or False in a hidden column if the
> task is complete or not. Then I tried sorting by that column first and
> then the due date afterwards. That didn't work either though because
> the complete items are pushed right to the bottom of the sheet -
> leaving hundreds of empty rows between!
>
> I'm sure there must be an easier way. Can anyone help?


0
pashurst (2576)
9/18/2007 10:14:22 AM
Reply:

Similar Artilces:

Diagram show blank as zero value when based on a formula
When a chart is based on a formula e.g. =IF(A1=0;"";A1*B1) then the chart will show the blank value "" as zero even if you whant to plot gaps or plot the empty cell interpolated. Yes, I know Excel say empty cell and the cell is not empty when there is a formula. Is there anybody who have found a "work around"? I often have formulas that generate zero in the result but I want to plot the result as if it was empty. I found the reply myself in a question from another user similar to this issue. I will use NA() instead of "" Thank you that works! &q...

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...

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...

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 ...

HELP: Add textbox to a frame at run time
Hi All, How can I add text boxes on the form at run time based on what user inputs in a textbox? For eg: I have a textbox "Total Students" , so Once I input a number in that textbox, I want to have that many textboxes on the form during run time. If I input 4 I want four textboxes to be displayed on the form. Thanks in advance ...

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...

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...

CDatabase help needed
Hi anyone know when and why CDatabase throwing an exception " Database already exists" " Driver's SQLSETCONNECTION Attr Failed" this comes when i tried to call CDatabase.OpenEx(myConnecString,NoOdbcdialog). There is nuthing wrong with ma connect string. help needed - Jibesh Hi, If you could supply details of your connection string and all relevant code we may be able to help. - Tim "jibesh" <jibesh.vp@m2comsys.com> wrote in message news:%233lKw%231QEHA.132@TK2MSF...

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...

I am trying to project out a line graph based on data
Hi, I have made a line chart based on some data for a fiften year period. I would like to plot out the future points for a thirty year period based on this data. Does anyone know how to do this? To perform a line projection, first click on the series the you would like to forecast. Go to Chart -> Add Trendline. The "options" tab will allow you to project the trend forward. You will probably want to use the "linear" option. It can also provide an equation which would allow you to manually calculate a future projection as opposed to using the trendline. -- Jo...

excel macro...PLEASE HELP!
Hi there, Here's what I would like to know how to execute. Assuming I have created a macro in place in a file. When I open that file, I want that macro to run...how do I do it? Thank your for reading and any suggestions are welcomed! Hi Jack Rename it Sub Auto_open() -- HTH. Best wishes Harald Followup to newsgroup only please. "Jack" <tangjack@yahoo.com> wrote in message news:00e601c38ceb$78b050d0$a301280a@phx.gbl... > Hi there, > > Here's what I would like to know how to execute. > > Assuming I have created a macro in place in a file. When...

Help #20
Hi, I have a worksheet with 3 columns: "month, Item type, quantity" : month Item Type quantity Jan. 1 2 2 1 3 1 Feb. 1 2 2 2 1 3 I want to rearrange this according to "Item Type" verses "month" in a new worksheet where it sums the quantity of each type (as follows): Item Type Jan. ...

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...

help with setting up which team plays who
Hello, i have 14 teams and i'm trying to get excel to list them all t play each other once at 6 games per week trying to get excel to figure this out for me a1= team1 b1=team2 c1=team3 d1=team4 all the way down to team n=team 14 how would you get excel to do this the simplest way -- Message posted from http://www.ExcelForum.com ...

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. ...

IIF(AND) statement
Hi I have a number of things I need to test in the query. I need to use IIF statement with AND (for example in Excel you can do it),. Example I need this IIf (and(cat="HS",cat2="JTK",cat3="NT"),"1","2") how to do it in access? -- Greatly appreciated Eva On 7 apr, 21:09, Eva <E...@discussions.microsoft.com> wrote: > Hi > I have a number of things I need to test in the query. I need to use IIF > statement with AND (for example in Excel you can do it),. > Example > I need this > IIf (and(cat="H...

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 ...

PDF exploits shown in this comparison as exceeding Flash based
Excuse the cross post, however, Windows 9X [being left out of the updating process] is just as vulnerable, if not more, than using outdated applications in other OSs. A basic explanation is found here: http://blogs.zdnet.com/security/?p=5473&tag=nl.e539 I suggest following the linked materials, and further research into the various methods being used. NOTE: that the use of "traffic optimization", which is running programs to detect the available exploitable aspects in any given OS and/or system, has increased, and is now the preferred method being used for mal...

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...

Entities with Multiple Entries - or Campaigns?
I hope someone out there will be kind enough to help me with this dilemma. Sorry this is lengthy but hopefully the description will make it easier to offer assistance. :-) We do a number of "marketing events" to which we invite clients and prospects. I've been reading a number of posts and thought I would be brilliant and create a new entity called "Marketing Events." In my dream I thought I would be able to create a list of events on one screen, then within contacts I would be able to select an event that a person had attended. Again, in my dream, I had th...

RE: server based archive solution #2
i was looking for a good server based email archive solutions...we currently have inidividual users using Outlook archive but i wanted to move the "responsibility" of archiving to the server-level ; the MSFT exchange sites lists some vendors (http://www.microsoft.com/exchange/partners/archivingandcompliance.asp) but i was wondering what other people had used and what they liked/disliked about the product they chose (or evaluated) ; thanks for any help!! Aloaha is quite good in archiving. If you buy their product they nearly implement you all feature requests. "Sunish Abraham...

Help
I recently restored my files from my laptop to my desktop pc and when I go to enter a transaction in the register it gives me a message that says "this transaction cannot be entered". How do I fix this? I am using Money 2002 and have never experienced any problems before. Take a look at the FAQ at http://www.bollar.org/msmoney/#S7Q5 "Kerry Shaha" <kmshaha@comcast.net> wrote in message news:05c201c35645$623b9530$a601280a@phx.gbl... > I recently restored my files from my laptop to my desktop > pc and when I go to enter a transaction in the register > it ...

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...

OneNote and file server based shared notebooks
Hi all! I seem to be getting a known error. When Office 2007 SP2 was applied to some systems, the users can no longer set up a shared notebook if it is on a file server. After looking, the problem seems to occur only on file servers that have IIS (WebDav specifically) running. Our server does! I can create shared notebooks in SharePoint document libraries, and on file servers that are not running IIS. I found this article, but does anyone know if a patch or fix was ever released? http://blogs.msdn.com/david_rasmussen/archive/2008/01/16/onenote-2007-sp1-can-t-create-noteb...