How to quickly insert a line based on current date in Excel


You have a sheet that already has a row with dates, and you want to add a line that will automatically update to reflect the current date each time the workbook is opened. This line should be inserted directly to the right of the row holding the dates.

Insert a Current Date Line

Utilizing the Conditional Formatting method will allow you to populate a cell with a date line that is up to date.

Step 1

Clicking the Home button comes after first selecting the range into which you wish to insert the line.

Step 2

Now choose Conditional Formatting from the menu. When you click on the Conditional Formatting option, you will see New Rule appear in the choices, as indicated in the following paragraph.

Step 3

Following the selection of the New Rule button, a new dialogue box that bears the term New formatting Rule will appear.

Step 4

In this particular case, you may decide which cells need to be formatted by using a formula, and then typing the formula =IF(B$1=TODAY(),TRUE, FALSE) into the text box labelled "Format values when this formula is true."

Note − If you want the results of your IF statement to be returned as the logical values (Boolean values) that other formulae can understand, make sure that you do not surround them in double quotes. This will ensure that the results are returned correctly. Middle aligns in a cell, as seen in the picture that was just shown to you, is a graphical representation of a Boolean.

Put "TRUE" and "FALSE" inside of "double quotes" if you want these terms to be treated as standard text values. In this scenario, the values that were returned will have the General formatting applied to them and will be aligned to the left. The words "TRUE" and "FALSE" will not be recognised as logical values by any Excel calculation that you use.

Step 5

To access the format cells dialogue, choose Format from the menu. To customise the border, go to the Border tab, choose the kind of line you want, and then choose the colour you want, as shown below.

Step 6

Select the OK button. A new line has been automatically added to the right side of the data cell that is now active.

Conclusion

In this tutorial, we explained in detail how you can insert a line in Excel based on the current date.

Updated on: 10-Sep-2022

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements