Conditional formatting highlighted a Date Range - excel

I’ve been struggling to try and figure this one out, it to do with conditional formation in Excel. I want to find a way to highlight the next payment schedule based on the current date. So if today was 10 Feb, the next payment schedule would be 15th Feb and is therefore highlighted. If today was the 16th Feb, A6 and B6 would be highlighted
Can any one help me with the formula for this, I’m assuming its conditional formatting with a formula. but the formula stumps me. this formula would need to be applied to a large range of dates (600 dates)

Simply try this formula:
=COUNTIFS($A$2:$A$9,"<="&$A2,$A$2:$A$9,">"&TODAY())=1
if you want to show also a day which is the actual day then simply add the = to the today part:
=COUNTIFS($A$2:$A$9,"<="&$A2,$A$2:$A$9,">="&TODAY())=1
but make sure to not miss any $ (or do to much of them) ;)
alternatively you also could use the short formula (which may be slower for bigger tables:
=$A2=MIN(IF($A$2:$A$9>TODAY(),$A$2:$A$9))
$A$2:$A$9>=TODAY() will include the actual day

Related

conditional formatting - if and statement

I am working on an if/and statement in conditional formatting.
I have 2 sheets. --- YTD Summary and Parameters
I want to conditional format the following 'YTD Summary'! I11:I31
These are set up as Percentages. The Parameters page has cell B2 with one of the following variables depending on what month it is (Jan, Feb, Mar, Apr, etc.)
the formulas I have tried are as follows
AND(Parameters!$B$2="Oct,'YTD Summary'!$I$11<(3/12-.05))
and(Parameters!B2="Oct",'YTD Summary'!I11<3/12-.05)
Conditional formatting takes the formula, but doesn't turn any of the percentages red within the specified range (I11:I31). Yes, I have formatted it for red text. Any help would be much appreciated. I have spent way to much time on this. thank you, Matt
=AND(Parameters!B$2="Oct",I11<0.2)
This worked for me. If the B$2 reference needs to move downward with the values in I, then remove the $ before 2.
Thanks!

SUMIF a range of amounts based on a particular month and year

How do i sum up a range of amounts after checking through the month and year?
As you can see in the image, my code currently sums up all amounts by checking only on the month. This is incorrect as it should check the year as well before auto summing itself into the respective months and year.
Here is the Excel Cell code:
Cell C36="$"&SUMIF(B17:B23,"*."&TEXT(B30,"mm")&".*",E17:E23)-SUMIF(B17:B23,"*."&TEXT(B30,"mm")&".*",G17:G23)
I tried modifying the code to add in a "yy" as shown below, but it didnt work out. In fact the 2017 amount of $555 reflected in 2018 instead.
="$"&SUMIF(B17:B23,"*."&TEXT(B30,"mm")&"."&TEXT(B30,"yy")&"",E17:E23)-SUMIF(B17:B23,"*."&TEXT(B30,"mm")&".*",G17:G23)
What do I need to change?
BTW, Cells B30 and B36 are Custom formatted to "mmm-yy" while Cells B17 and B18 is Text.
managed to solve my own code.
Apparently its just a change in the parameters.
Cell C36="$"&SUMIF(B17:B23,"*."&TEXT(B30,"mm.yy")&"*",E17:E23)-SUMIF(B17:B23,"*."&TEXT(B30,"mm.yy")&"*",G17:G23)
Here is an alternative. SUMPRODUCT allows you to use RIGHT function to do the comparison for mm.yy.
="$" & SUMPRODUCT((--(RIGHT(B17:B23,5)=TEXT(B36,"mm.yy")))*E17:E23)-SUMPRODUCT((--(RIGHT(B17:B23,5)=TEXT(B36,"mm.yy")))*G17:G23)

Identify due date excluding weekends

I am using the following formula to change a cell's conditional formatting depending on how close to today's date the value is:
Cell Value is Between =TODAY()-5 and =TODAY()+5
This is working but I want to exclude weekends.
So if the date in the cell is 03/10/14 and today's date is 26/09/14 I would like to be able for my formula to identify that there are only 6 days and not 8 days which would include the weekend.
Please can someone tell me how what formula I would need to use to do this? I have tried to use the WORKDAY() function but can not seem to get it to work?
Assuming your dates are in ColumnA, please try this CF formula rule:
=AND(A1<=WORKDAY(TODAY(),5),A1>=WORKDAY(TODAY(),-5))

Cell reference in conditional formatting

My apologies if all the text in this document is in German, I'll try to explain it as well as possible.
Basically, this is just a sheet that contains the dates and times an employee was working. All the weekdays are automatically generated, e.g. when the month is set to October 2013, the weekdays automatically update. ("Di" -> "Tu"/tuesday, "Mi" -> "We"/wednesday, ...)
This works out alright, so I don't have any problems with that. What the actual goal is, I wanted to make it a little bit better readable by adding thicker lines after every sunday, signalizing the end of the week.
Using the conditional formatting, I've managed to do that for every line. E.g. for line 14, I used the formula =MOD(VALUE($B$14);7)=1 to determine, if the value in column B and line 14 is in fact a sunday. If the modulus of the weekday divided by 7 is 1, then it is a sunday and the formatting style is applied to those cells.
Now, this formula makes it a little hard to work with. I'd basically have to copy-paste the lines each time and change the line number for each line. I thought it would be possible to make it more dynamic by leaving out the $-symbol (=MOD(VALUE($B1);7)=1), but for some reason it didn't work for me.
What do I have to type in inside VALUE to reference the B-Column in the same line?
Okay, the issue was that you were applying your condition on a range on the wrong active cell.
An active cell is the only cell which is slightly less blue in the selected region; for instance, in the picture below, the active cell is A1:
And if this is the active cell, you will be able to use your formula:
=MOD(VALUE($B1);7)=1
There's a simpler formula though:
=WEEKDAY($B1)=1
This means that if the active cell was A32 or H32 in the picture, the formula wouldn't have worked, because the condition for formatting is being applied to the wrong cell!

Compare dates of two cells in excel

I have dates in E2 and F2 cells of an excel.The dates are in MM/DD/YYYY fromat.I want to apply validation in such a manner that date in F2 must be greater then dates in E2 .
In case of failure we should display an error.
I am using Microsoft Office 2007.
Help would be appreciated.
You could use conditional formatting?
In your case the background of one of the dates could turn red if the date is too low compared to another.
Quick google:
http://www.homeandlearn.co.uk/excel2007/excel2007s6p2.html
Should be quite easy doing =IF(F2>E2;"SUCCESS";"ERROR")
You can omit the "SUCCESS" and you only display the error should it fail. This will work as long as the fields are actually formatted as a proper date.
Updated code:
=IF(AND(NUMBERBLANK(E2:F2)=0;F2<E2);"ERROR";"")
What this does is: Check if both cells are filled, if they are chech if E is smaller than F, and write ERROR if that is the case.
To do this for the entire column you need to replicate the formula. For existing dates, just double click the lower right knob in the cell the formula is, and it SHOULD replicate down till the end of the row (if the row is next to the date). Other than that, just pull the knob down as far as you need it.

Resources