TODAY Function

Relevant answer

David Horton 1 year ago

For clarity, please supply a screenshot (not photograph) of your spreadsheet including column and row headers.

https://spreadsheetplanet.com/using-if-function-with-dates-in-excel/

0 Likes

Relevant answer

Dave Houston 1 year ago

You can only do this with VBA if you want it to automatically enter each time you add a row. Personally, I'd just input the date one time into a large amount of rows, then delete off the ones you don't use at the end of the day.

2 Likes

Relevant answer

Bria Johnson 1 year ago

Harold Horsman Wondering if you could help me figure out a little further. I added a formula =and($D2:$D - today() <= 0) ---> so when the expiration date is today or in the past, the cell can be colored bright red. However when I do that all of the empty cells turn highlight red as well too. So I created another rule that if the cell is empty the highlight would be "none". however, that did not take care of the problem. Any support you could provide?

1 Like

Relevant answer

Will Taylor 1 year ago

Try: =IF(AND(Q6="",R6=""),"",NETWORKDAYS(Q6,IF(R6="",TODAY(),R6)))

the above formula calculates the number of working days between two dates, excluding weekends.

Here's how it works:

  1. The IF function checks whether cells Q6 and R6 are both blank. If they are, the formula returns an empty string (""), indicating that there are no working days between the two dates.

  2. If cells Q6 and R6 are not both blank, the formula calculates the number of working days between the dates in Q6 and R6 (inclusive). If cell R6 is blank, the formula uses the current date (TODAY()) as the end date.

  3. The NETWORKDAYS function calculates the number of working days between two dates, excluding weekends (Saturdays and Sundays) (We can use any dates listed in the holidays parameter - which is not specified in this formula).

  4. So, if Q6 is the start date and R6 is the end date (or the current date, if R6 is blank), the formula will return the number of working days between those two dates, excluding weekends. If either Q6 or R6 is blank, the formula returns an empty string.

0 Likes

Relevant answer

Khurram Shahzaib 1 year ago

Yes, you can use the following formula to get the date that is 7 days earlier than the current date:

=TODAY()-7

This formula uses the TODAY function, which returns the current date, and subtracts 7 days from it to give you the date that is 7 days earlier.

To apply this formula to your data tables, you can follow these steps: Enter the formula =TODAY()-7 into a cell in your worksheet, such as cell A1. Format the cell as a date format by right-clicking the cell and selecting "Format Cells." In the Format Cells dialog box, select the "Date" category and choose a date format that you prefer. Copy the cell that contains the formula by selecting it and pressing Ctrl+C (or right-clicking and selecting "Copy"). Select the cell where you want to display the previous week's date, such as the top cell of your data table. Paste the formula into the cell by pressing Ctrl+V (or right-clicking and selecting "Paste"). Now, the cell will display the date that is 7 days earlier than the current date, and you can use this cell as a reference for copying your data table with the correct date.

0 Likes

Hot network questions