Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8331425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:24:52+00:00 2026-06-09T02:24:52+00:00

Consider the following (partial) Excel worksheet: A | B | C | D —+————-+——-+——-

  • 0

Consider the following (partial) Excel worksheet:

A  |   B         |  C    |  D
---+-------------+-------+-------
id |  date       | var_a | var_b
1  |  2011-03-12 | 200   | 34.22
1  |  2011-03-13 | 203   | 35.13
1  |  2011-03-14 | 205   | 34.14
1  |  2011-03-15 | 207   | 54.88
1  |  2011-03-16 | 208   | 12.01
1  |  2011-03-18 | 203   | 76.10
1  |  2011-03-19 | 210   | 14.86
1  |  2011-03-20 | 200   | 25.45
.  |  .          |  .    |  .
.  |  .          |  .    |  .
2  |  2011-03-12 | 200   | 34.22
2  |  2011-03-13 | 203   | 35.13
2  |  2011-03-14 | 205   | 34.14
2  |  2011-03-15 | 207   | 54.88
2  |  2011-03-16 | 208   | 12.01
2  |  2011-03-18 | 203   | 76.10
2  |  2011-03-19 | 210   | 14.86
2  |  2011-03-20 | 200   | 25.45
.  |  .          |  .    |  .
.  |  .          |  .    |  .

In reality, there are over 5.000 rows. I need to delete all rows which date falls on a saturday or sunday. In the example, March 12 and 13 (2011-03-12/13) and March 19 and 20 are Saturdays and Sundays. I cannot just delete every nth rows, since there might be days missing in the list (as is the case here with 2011-03-17).

Is this possible to do with either a formula or VBScript? I have never written a VBScript macro before (I have never had a use for it) so I would appreciate some help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T02:24:53+00:00Added an answer on June 9, 2026 at 2:24 am

    If you only need to do this once, this is what I would do. This should preserve the order, but if you’re really worried about it, read very end of the post:

    1. Add a new column, call it “Is Weekend”. In it, put =if(WEEKDAY(B2, 2) > 5, 1, 0). Drag that formula down for the entire table.

    2. Filter the columns. To do that, select the entire table (click on any table cell then hit Ctrl-A), then

      • On Excel 2007+, go to Data-> click “Filter”
      • On Excel 2003, go to Data->Filter->Auto Filter.
    3. Sort everything by last column (Is Weekend) in descending order. This should put all weekend rows together without altering the order among the other rows.

    4. Delete all rows with 1 in “Is Weeked” column. Delete that column.

    If you’re really worried about preserving order, before you do the above, you can do the following:

    1. Add a new column called “Position”. Put 1 in the first row, 2 in the second row, select them and drag it down to the bottom so every row has its own position number in increasing order.
    2. Perform the filtering as above.
    3. After you’re done, sort everything in ascending order by “Position” column.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following (partial) Excel sheet: | A | B C D -+---+------------------ 1|id
consider the following code, which represents an attempt to implement partial matching. the intended
Consider following: Partial View: <%= Html.ListBox(BlackList, Model.Select( x => new SelectListItem { Text =
Consider the following code: public partial class TeacherControlPanel : System.Web.UI.Page { protected string username
Consider the following code snippet: public partial class DatabaseContext : DbContext { protected override
Consider the following partial, it gets inserted into a page if someone clicks AJAX
Consider the following code: partial class OurBusinessObject { partial void OnOurPropertyChanged() { if(ValidateOurProperty(this.OurProperty) ==
Consider following make: all: a b a: echo a exit 1 b: echo b
Consider following code: My problem is: 1) I can't seem to cast the errors
Consider following string Some string with quotes and \pre-slashed\ quotes Using regex, I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.