Conditional Formatting TODAY() with Date + Time in cell - excel

What I am trying to do is highlight cells that contain both a date and time together, I would like it to ignore the time and highlight the cell if the date is equal to TODAY.
For example:
-| A | B |
1 | Option1 | 06/17/2020 0800 |
2 | Option2 | 06/17/2020 1500 |
3 | Option1 | 06/18/2020 2300 |
4 | Option1 | 06/20/2020 0800 |
I would want B1 and B2 highlighted if today was 06/17/2020.
I tried a few different formulas in conditional formatting I found on Google, but with no luck.
Thank you!

Use a rule based on the following formula:
=--(LEFT($B1,10))=TODAY()
Apply to column B.
Note that this assumes that the date portion is always in the format mm/dd/yyyy, i.e. it takes up the 10 left characters.

Related

Using CountIfs to check if cells have dates or are empty

I have written a formula to check if a small range has a date in the cells. My data looks like this:
+----------+------------+
| Proposed | Dates Used |
+----------+------------+
| 0 | 9/23/2019 |
| 0 | 9/24/2019 |
| 0 | 9/25/2019 |
| 0 | 9/26/2019 |
| 0 | 9/27/2019 |
| 0 | 9/29/2019 |
| 0 | 9/30/2019 |
| 1 | 10/2/2019 |
| 1 | |
| 0 | |
+----------+------------+
My current formula looks like this: =COUNTIFS(Propsed_Days,0,Dates_Used,"<>0")
This returns an error. I have also tried =COUNTIFS(Propsed_Days,0, Dates_Used,"<>"), which also returns an error. (I am using defined names to cover the ranges, right now Propsed_Days covers both columns and Dates_Used covers just the date column)
Basically what I want is to get a count of dates that have the Proposed column = 0, but don't want to count when there is no date but proposed is = 0. My table above should = 7 because there are 7 dates that have a proposed = 0 the date with the proposed = 1 should be excluded and the 2 lines (one with Proposed = 0 and one with Proposed = 1) should be excluded because there are no dates in the Dates Used column.
I have tried searching for a solution and tried answers from Using COUNTIFS to count blank when cell has a formula and How do I get countifs to select all non-blank cells in Excel?, but neither questions answers have worked for me.
The named range "Proposed Days" will cause the issue since this is for both columns, you need to adjust this to only cover the first column.
Once you've done that you need to concatenate the condition like so.
=COUNTIFS(Proposed_Days,0,Dates_Used,"<>"&0)
The following formula will work ONLY IF the last two cells in your Dates_Used column is completely blank but not a blank returned by a formula.
=COUNTIFS(Propsed_Days,0,Dates_Used,"<>")
I suspect the dates in your Dates_Used column are returned by a formula so the blank cells are not really blank. If that's the case, the following SUMPRODUCT formula will do the job:
=SUMPRODUCT((Propsed_Days=0)*(LEN(Dates_Used)>0))
Cheers :)

Ms excel - how do I add 1 day to my custom date?

I'm trying to add days consecutively across row 9 starting with Sunday.
In field e3 is the date for the beginning of the pay period in 6/24/17 format
In field c9 I have =TEXT(E3,"ddd, m/dd")
In d9 I have tried
=TEXT(E3,"ddd, m/dd")+1
=C9+1
And a few other ways but it returns "value"
How can I get the days in my custom format to auto grow in the custom format I have based on the original date in e3?
Don't use TEXT to format a date. Rather, right click on the cell(s), select Format Cells, Number, Custom, and enter your custom format there.
To increment dates, simply doing =dateCell + 1 works so long as that cell is a date; if it's not you're attempting to add 1 to a string; which doesn't make sense.
Example
Create a sheet with the following values/ formulae:
| A | B |
1 | Date | Formatted Date |
2 | 2017-06-24 | =A2 |
3 | =A2 + 1 | =B2 + 1 |
Leave column A's formatting as General; Excel will figure out that it's a date and will display it according to your local settings.
In column B, follow the steps above to format the cells as ddd, M/dd.
The result should look like this (column A's behaviour depending on your regional settings):
| A | B |
1 | Date | Formatted Date |
2 | 06/24/2017 | Wed, 6/24 |
3 | 06/25/2017 | Thu, 6/25 |

Excel: Average of parts of a column based on another column

Using Excel 2011 for mac, I have three columns: ID, Start date, end date and time to completion. (Date format: dd/mm/yyyy)
ID | Start | End | Time
1 | 01/01/2016 | 05/01/2016 | 4
2 | 04/01/2016 | 08/01/2016 | 4
3 | 01/02/2016 | 14/02/2016 | 13
4 | 02/02/2016 | 20/02/2016 | 18
5 | 01/03/2016 | 05/03/2016 | 4
6 | 06/03/2016 | 08/03/2016 | 2
7 | 12/03/2016 | 15/03/2016 | 3
Column D is basically the difference between column C and column B.
Now I have the total average, which is easy to calculate but I'd also like to have the averages for the different months.
And this is where my knowledge falls apart. I've tried several things but I can't seem to figure out how to calculate an average using only the cells in a column that match a certain value in another column. I could sort the tickets by date and do it manually by doing the average for only a certain range but as this list constantly changes this is definitely not a nice option.
Check out the AVERAGEIF function
AVERAGEIF(selection_range, criteria, averaging_range)
It uses the values in the selection_range to filter which values in the averaging_range will be averaged.
In your case you could say AVERAGEIF(B1:B8, "01/01/2016", D1:D8)
There are multiple ways. I would personally use an array formula, but that may be a bit advanced and overly complicated.
I suggest adding a column E "Month" - into E2 add:
=MONTH(B2)
Then copy cell E2 to E3:E8.
Now you can easily get a monthly average by applying the AVERAGEIF command:
=AVERAGEIF(E2:E8,2,D2:D8)
The second argument, 2, indicates February, but may be exchanged with any number from 1-12.

MAX date value within a range with 2 conditions

To make it easy
+---+----+-------------+
| | A | B |
+---+----+-------------+
| 1 | xx | 12-05-2015 |
| 2 | xx | 15-05-2015 |
| 3 | yy | 13-05-2015 |
| 4 | yy | 16-05-2015 |
+---+----+-------------+
(today is 14-05-2015)
I need to get the MAX date value for each "A" value only if it is before today.
In case it's not, move to the 2nd biggest value. Case it does not find, empty cell.
What I've done so far:
=MAX($A$1:$A$4='xx';$B$1:$B$4<TODAY();$B$1:$B$4)
and confirm with SHIFT+CTRL+ENTER
The error I get is that it yields 13-05-2015 as max value for xx, which is obviously wrong (as if it does not take into account the $A$1:$A$4='xx'
You need to use nested if-functions. I.e. change your formula into:
{=MAX(IF($A$1:$A$4="xx", IF($B$1:$B$4<TODAY(), $B$1:$B$4)))}
And end it with Ctrl+Shift+Enter
A standard (non-array) formula alternative.
=MAX(INDEX((B:B)*(A:A="xx")*(B:B<TODAY()), , ))
      
This formula would benefits from having its cell ranges cut down from full columns to something closer to the usable data range.
If your dates are sorted ascending as shown in the example then you can use LOOKUP like this:
=LOOKUP(2,1/(A$1:A$100="xx")/(B$1:B$100<TODAY()),B$1:B$100)
Doesn't require "array entry"

MS Excel - finding the first row after a certain date

Say I have a spreadsheet with the following, and for convenience say all of this starts from cell A1.
---------------------------------------
| Date | Item | Account |
---------------------------------------
| 01/09/2011 | Testing 1 | USD |
| 03/09/2011 | Testing 2 | USD |
| 11/09/2011 | Testing 3 | USD |
| 20/10/2011 | Testing 4 | JD |
| 22/10/2011 | Testing 5 | JD |
| 25/10/2011 | Testing 6 | USD |
| 03/11/2011 | Testing 7 | USD |
| 05/11/2011 | Testing 8 | JD |
---------------------------------------
Now, I want to run a report for a month, starting on 1/10/2011 and ending on 31/10/2011. I need to find the first row on or after the starting date, and then get every subsequent row until the end date. If I can figure out how to get the row reference for the first and end dates, then I can figure out the rows in between (obviously!).
I have only been able do these sorts of matches on exact matches ie. no idea how to do 'greater/less than' matches.
How would I go about matching on both the date and the account columns?
Needless to say, this needs to be in a formula.
=match(date(2011,10,1),a2:a9,1)+1
=match(date(2011,10,31),a2:a9,1)
First formula shows row for the first record for October, second formula for the last day. Data must be sorted in ascending order.
Use the following Array Formula for finding the Row containing the earliest date, which is equal to or greater than the date mentioned in cell C1 (in your case this is 1 October).
=MATCH(MIN(IF($A$1:$A$30>=C1,1,9999)*$A$1:$A$30),$A$1:$A$30,0)
Date list is in cells A1 to A30. Change the references as required.
Data need not be sorted in ascending or descending order.
Use the following Array Formula for finding the Row containing the latest date which is equal to or less than the date mentioned in cell D1 (in your case this is 31 October). Data need not be sorted in ascending or descending order.
=MATCH(MAX(IF($A$1:$A$30<=D1,1,0)*$A$1:$A$30),$A$1:$A$30,0)
If you want the earliest and latest dates, use the following Array Formulas.
=MIN(IF($A$1:$A$30>=C1,1,9999)*$A$1:$A$30)
=MAX(IF($A$1:$A$30<=D1,1,0)*$A$1:$A$30)
All the formulas used above are Array Formulas. To enter an array formula, use Control+Shift+Enter instead of Enter.
Vijaykumar Shetye, Goa, India
I would recommend using a pivot table for this. Look at the second link on in the "Excel Templates - Pivot Table" section on this page on the Contextures site.

Resources