I need to count all dates that are "less than" today to see which work is overdue. I understand that this can be done simply with
=countif(F:F,"<"&TODAY())
However, the dates in Column F are formatted like "12/05 - Evening" instead of just "12/05". Because of this, the formula is not picking up anything. Does anyone know how to change this code so that it counts any cell that contains dates prior to today, even if there is other text in the cell? I've tried playing around with these "**", but can't get it to work.. Thank You!
So based on my comment I would get the date by using left() with find() like so:
LEFT(A1,FIND(" ",A1,1)-1)
Then format as short date and it behave as a date.
From comment:
Use a helper column and separate the date out then use the countif() on that column
Related
I have two columns, Last Upload and Final Date. I have a formula to calculate the difference between today and the Last Upload using
=DATEDIF( [#[Last Upload]],TODAY(),"d")
However, sometimes the Last Upload column will be blank and in this case we would like to use the Final Date column instead.
Is there a way to combine and use the above statement when the column is not blank and the other when it is? I have been trying to nest it with an IF statement but struggling to do so.
You could use ISBLANK formula combined with IF formula.
=DATEDIF(IF(ISBLANK([#[Last Upload]]),[#[Final Date Upload]],[#[Last Upload]]),TODAY(),"d")
Alternative solution:
=DATEDIF(IF(LEN([#[Last Upload]]),[#[Last Upload]],[#[Final Date]]),TODAY(),"d")
LEN might be a little bit more error-proof than ISBLANK.
Hi there I am trying to use the =NETWORKDAYS formula in Excel to calculate the number of workdays passed between two dates minus public holidays on a separate sheet. When I enter the correct formula I get an unreasonably large negative number like -29221 workdays between 2017-04-28 to 2018-04-24. I've tried to change the NumberFormat of the cells, ignoring public holidays etc. but I still get these numbers. Am I doing something wrong?
Here's my formula:
=NETWORKDAYS(2018-4-24,D2,PUBLIC_HOLIDAYS!E44:E61)
Couldn't find anything on the internet that would solve this.
2018-4-24 probably isn't being read as a date value, insert it into a cell and change to general to get it's "value" or use it in Date() like so:
=NETWORKDAYS(DATE(2018,4,24),D2,PUBLIC_HOLIDAYS!E44:E61)
Static date is being read as text. Enclose it in quotes or use date function. Consider these options:
=NETWORKDAYS("2018-4-24",D2,PUBLIC_HOLIDAYS!E44:E61)
OR
=NETWORKDAYS(DATE(2018,4,24),D2,PUBLIC_HOLIDAYS!E44:E61)
If it still doesn't work, check the cells that you're referencing. Make sure you're referencing dates or its equivalent value and not some random numbers.
Hope this helps..
I´ve spent a lot of time with a formula in Excel and I´m still blocked. I hope you can help me.
I have a table in Excel with several values as shown in this
screenshot.
What I´m trying to extract is the number of Fruits sold in a specific month. That is, how many lemons were sold in January 2016, for example. This is the formula I´m using:
=SUMPRODUCT((B3:B38=E4)*(MONTH($A$3:$A$150)=12)*(YEAR($A$3:$A$150)=2015);$C$3:$C$150)
But the result is #N/A as seen in the screenshot.
What Am I doing wrong? Any help, please?
Thanks a lot in advance!
You can use arrays in excel to get this answer
{SUM(IF(MONTH(F$3&"1")=MONTH($A$3:$A$150),IF($E4=$B$3:$B$150,$C$3:$C$150,0),0))}
You can use this Sumproduct formula which uses array logic:
SUMPRODUCT((MONTH($A$3:$A$38)=MONTH(TEXT(G$2,"MMM")&1))*($C$3:$C$38=$F4)*
($D$3:$D$38))
Sumproduct Demo
Part of your problem is your ranges are not equal in length. B3:B38 has to be the same number of rows as $A$3:$A$150 and C3:C150. When rows are not equal things blow up on you.
=SUMPRODUCT(($B$3:$B$150=$E4)*(MONTH($A$3:$A$150)=12)*(YEAR($A$3:$A$150)=2015);$C$3:$C$150)
if you change your header row to be actual excel date format, and then change the cell display format to just show the month (as suggested by csanjose), then you can adjust your sumproduct formula as follows and copy to all cells in your table.
=SUMPRODUCT(($B$3:$B$38=$E4)*(MONTH($A$3:$A$150)=Month(F$3))*(YEAR($A$3:$A$150)=Year(F$3));$C$3:$C$150)
Fill your month-row with the last day of each month, then apply date format to show only month name.
The formula you should use is, for example, in g8:
=SUMIFS($C:$C;$B:$B;$E8;$A:$A;"<="&G$3;$A:$A;">"&F$3)
First column "F" doesn't have a column on the left to compare, so you can put a date in E3 or change a bit the formula (example of F8):
=SUMIFS($C:$C;$B:$B;$E8;$A:$A;"<="&F$3;$A:$A;">2015/12/31")
Take a look at the result
If you don't want to use a pivot table, you can use this formula to get what you need:
=SUMPRODUCT(($B$3:$B$150=$E3)*(MONTH($A$3:$A$150)=1)*(YEAR($A$3:$A$150)=2015)*$C$3:$C$150)
Then drag-fill the cell to copy it to every month column (just make sure you change the month number in the formula (and year if you're doing that too)), and then drag-fill down the columns.
That should work pretty food good :)
Good Luck!
Three columns below, I'm attempting to use column C as a formula that checks against a hard coded date.
8/18/14 12/19/20 formula
In column C =IF(AND("10/7/15">=A1,"10/7/15"<=B1),"IN","OUT")
What I'm looking for is to tell if 10/7/15 is between 8/18/14 & 12/19/20 - I would expect that to come back with a value of IN but it doesn't.... hoping its something simple I'm missing
I think the problem is you're comparing a date (which translates to a number) to a text string. It's a crap-shoot as to what Excel will do in this case. If you compare a date to a date, I believe you will get the desired behavior:
=IF(AND(DATE(2015,10,7)>=A1,DATE(2015,10,7)<=B1),"IN","OUT")
The datevalue function should also work.
If you really have a date in A1, you can try:
=IF(AND(VALUE("2015-10-07")>=VALUE(A1),VALUE("2015-10-07")<=VALUE(B1)),"IN","OUT")
I have dates within a cell using this format: (February 13 2014).
When I try to use "WEEKDAY(C2)" I get #VALUE!
I have no idea how to fix this and I need some help to finish this web scraping project. Any ideas?
The problem is that the date is a string, and not a real Excel date formatted as you show. The WEEKDAY function needs have a "real Excel date" as its argument, not a string.
If the apparent spaces between the date components are spaces, then the following formula should work:
=WEEKDAY(--SUBSTITUTE(C5," ",", ",2))
EDIT: As David Zemens just pointed out, the double unary seems to be unnecessary with the weekday function. So
=WEEKDAY(SUBSTITUTE(C5," ",", ",2))
should be a better solution.
If they are something else, the formula would be different, but the principal would be similar
Another method: You may be able to convert it to a "real date" by using the Text to columns wizard, but DON't split it on anything. (You can do that by selecting something like TAB as the delimiter; since there are not tabs, no splitting). When you get to step 3, merely check that it is a date in MDY format. That wizard is pretty smart. Then you can use the WEEKDAY function directly.
One way to do so... maybe not best since it involves adding so many rows
Add a fresh column D and E if not available..
Then use Text to Columns on Column C, with space as delimiter... (This will split column on spaces into 3 columns)
Add a new Column D with formula
=MONTH(C3&1)
Make sure new Column D is of type General or Number rather than Date
Then you can use the following formula
=DATE(F3,D3,E3)
Formula only:
=WEEKDAY(DATE(RIGHT(C2,4),MONTH(LEFT(C2,FIND(" ",C2)-1)&1),(MID(C2,FIND(" ",C2)+1,2))))
with thanks to #tgeery.
Your dates are not in the correct format.
WEEKDAY(DATE(2014,2,13))
should work because the argument for the weekday function needs to come from the DATE function.