Sometimes, you would like to compute certain information or show some results only for the dates till date. In other words, you would like to hide the results for all the future dates. In this article, you’ll learn how to do this in Excel. As the logic behind this would be to hide the results based on certain conditions (in this case date), we’ll be using conditional formulas like IF, COUNTIF and SUMIF.

Let’s take an example and see how we can accomplish this. In this example, we are considering Daily forecast vs actual orders comparison table. For sake of simplicity, I’ve taken data only for one month. Please use the following Excel file as the initial data to start with:

Download workbook to follow along

Follow the below steps to Hide Formula results based on Date:

  1. When you download and open the file, you will see the data like the snapshot belowHide results based on Date 1
  2. Notice that the Actual orders data is filled only till 12th Jul, this is because this file was created on 13th Jul and the data for orders was available only till 12th Jul
  3. You can make the changes to the date as per the date you are in just by updating date in cell A2 to the first day of your current month
  4. First, let’s have a look at how we can calculate the Actual to Forecast Ratio without any conditions involved.Hide results based on Date 2
  5. As shown in the screenshot above we use the formula C2/B2 in cell B2 to get the ratio.
  6. But, if we drag the same formula down to all the other rows, you’ll notice the result will be 0 from cell D14 onwards (as highlighted in the screenshot below)Hide results based on Date 3
  7. This is not desirable, instead, we would like to hide these results
  8. Now, let’s see how we can calculate the Actual to Forecast Ratio only till 12th based on the entry made in column C
  9. Let’s update the formula in cell D2 to the following conditional formula using an If condition:

IF(C2=””,””,C2/B2)

Hide results based on Date 4

  1. The IF statement takes three parameters. First, is the logical condition to check. Second, the value or the result to show if the condition is evaluated to be TRUE. Third, the value or the result to show if the condition is evaluated to be FALSE
  2. In this case, we are checking if the value in C2 is blank or not. If the condition evaluates to be TRUE (i.e. C2 is blank) then make the result of the formula blank. If the condition evaluates to be FALSE (i.e. C2 is not blank) then compute the result as C2/B2
  3. If we drag the same formula down to all the rows below, we’ll notice that the results populate only till the 12th Jul row (as highlighted in the screenshot below)Hide results based on Date 5
  4. Now, to make the condition dependent on date, we’ll use the date comparison in the IF condition then, evaluate the results accordingly.
  5. We’ll compare the date in column A with the current date using TODAY() formula and based on that show a blank text or evaluate the ratio.
  6. If the date is today or later, in that case, show blank else calculate the ratio, to perform this we’ll use the following formula:

IF(A2>=TODAY(),””,C2/B2)

  1. Note that the result of this formula is same as earlier (refer to the screenshot below-taken on 13th July)Hide results based on Date 6

With this, I would like to conclude by saying with the help of conditional statements like IF we can modify the results of formula based on dates and other parameters like blank cells. If you would like to have a look at the solution refer to the following file:

Download the Excel with formula from here

Bonus: If You’d like to learn about how Date and Time work in Excel + All Excel Date & Time functions, you can watch our Excel Date & Time Masterclass on Youtube!

You can also download our Excel Date & Time functions Cheat sheet using the form below!

As alway, please leave a comment below if you have any queries/comment, we are always glad to read your feedback!

Please share

Did you find this useful?  Why not share the love and tell your friends on the different social media platforms.

Get our Excel Date & Time Functions Cheat sheet!


Enter your First Name & Email to get our Excel Date & Time functions cheat sheet and subscribe to our Newsletter!

Powered by ConvertKit

Get Free Email Updates!

Signup now and receive an email once I publish new content.

I agree to have my personal information transfered to ConvertKit ( more information )

I will never give away, trade or sell your email address. You can unsubscribe at any time.

Abdelrahman Abdou
Latest posts by Abdelrahman Abdou (see all)
It's only fair to share...Share on Facebook
Facebook
0Pin on Pinterest
Pinterest
0Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin