Excel: Select Records for Last 30 Days Criteria Example WrongLast reviewed: November 2, 1994Article ID: Q60911 |
SUMMARYThe formula =">=NOW()-30" on page 170 of the "Microsoft Excel Reference" version 2.2 manual does not select all records for the last 30 days in a database. To correctly perform this function, a computed criteria must be used, as in the following example (where B2 is a reference to the date field in the first record in the database):
=B2>=NOW()-30To set up the computed criteria, place this formula at the end of the criteria range. Do not include a fieldname as the heading for the computed criteria; either include a descriptive text string, or leave the cell above the formula blank. For example, if the criteria is located in cells G1:G2, enter the computed criteria in cell H2. Select cells G1:H2 and choose Set Criteria from the Data menu.
+---+----------+---------------+ | | G | H | +---+----------+---------------+ | 1 | Name | | +---+----------+---------------+ | 2 | | =B2>=NOW()-30 | +---+----------+---------------+For more information on computed criteria, see pages 171-172 of the "Microsoft Excel Reference" version 2.2 manual.
|
KBCategory: kbother
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |