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))
Related
Im exploring how feasible it is to extract data from cells that consist of text. ultimately. I will apply conditional formatting rules based on the date relative to today, but right now I just need to be able to extract them.
So far I have achieved the following:
To achieve this I've used the formula found online =IFERROR(DATEVALUE(LEFT(RIGHT(B2,(LEN(B2)-(FIND("-",B2)-3))),11)),""). The issue is that if a cell contains only a date, the Length is subtracted from itself and nothing is returned. I have tried modifying the above equation but keep running into errors.
Hoping someone may be able to help me out modify this formula. Alternatively, if anyone knows how dates can be extracted used just excel formulas that would be great.
The issue is that without the other text it is a true date and a true date is a double and has no - in it.
The simple fix is to wrap change the"" return from the IFERROR to B2:
=IFERROR(DATEVALUE(LEFT(RIGHT(B2,(LEN(B2)-(FIND("-",B2)-3))),11)),B2)
If that is not sufficient you can do an IF to test if date:
=IF(ISNUMBER(B2),B2,IFERROR(DATEVALUE(LEFT(RIGHT(B2,(LEN(B2)-(FIND("-",B2)-3))),11)),""))
This is a solution I came up with with appears to work for almost Any Date format provided the date is at the top of the cell. Note this was done for dates in cell H6 of my workbook.
The formula below can be entered below to extract the date from this cell amongst text.
=TEXT(IFERROR(LEFT(H6,SEARCH(CHAR(10),H6,1)-1),H6),"dd-mmm-yyyy")
This formula checks if the date is within 3 years and returns a true of false value. This can be used to conditionally Format Cells if the date once extracted is out of date.
=IF(ISBLANK(H6),FALSE,IFERROR(IF(DATEVALUE(TEXT(IFERROR(LEFT(H6,SEARCH(CHAR(10), H6, 1)-1),H6),"dd-mmm-yyyy"))<=TODAY()-(365*3),TRUE,FALSE),TRUE))
Works really well for me!
I try to evaluate if a cell contains a valid date. If the content is not a valid date, the cell should be colored red. I want to do this without vb. On SO i got told, this is possible using only conditional formatting
Here is my try:
This doesn't work. I think the formular is fine, because i get no error message, but still no success.
Another try was to use Highlight Cells Rules and depending on a date occurring.
But here i can only use specific rules, like date is from this week, or this month, or past week. I can not say is a valid date or is a date between X and Y.
Any ideas how i can achieve my goal to set background-color of cells with invalid date-formats?
The issue comes from the fact that 31.12.1899 is not a reconized date in Excel.
An excel date is a number and it starts with 0 = 00.01.1900
So if you exchange your 31.12..1899 by 01.01.1900 your formula will work.
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)
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
I need to show dates only after 31/12/2012. The Date column used here is a calculated column. I used the formula =[Created]>12/31/2012. But I need help with the syntax.
Any help will be appreciated.
Thanks in advance.
If you need only "Yes/No" value to filter Created date then your formula is correct. You may have a problem if your regional settings are MM/DD/YYYY. In that case you should change the formula to [Created]>31/12/2012. Or the better way would be to change the condition to [Created]>=01/01/2013.
If you need the date, not "Yes/No" column, then this formula should work for you:
=IF([Created]>=1/1/2013,[Created],"TOO OLD")