Writing a COUNTIFS with a date value - excel

I have a COUNTIFS and I want to say "Count if date >= "value in cell B4"
so lets say I have something like
=COUNTIFS(MySheet!C:C,"Y",MySheet!D:D,">=B4")
It obviously does not recognise that it is looking for a date in cell B4 and therefore I get 0 as a result.
What syntax should I use so it recognises that I am looking for anything where the date is greater to the date in cell B4?

Solution
=COUNTIFS(MySheet!C:C,"Y",MySheet!D:D,">="&B4)
Reason
Anything you enclose in quotes ("") is taken as a string literal. So it was looking to see cells whose value was ">=B4", instead of cells whose value was greater than the value in cell B4.

Related

Date Range Look up, Returned Value

I am searching a range of cells that contain dates. I want the formula to examine if any of the said dates are before a specified date. If the statement is true I want the formula to put yes in the cell, if false i want the formula to put no in the cell
=IF(COUNTIF('ESU1'!D3:D50,"<date(2014,1,1)"),"Yes","No")
Based on the cells range there are dates before specified date but returning the fals results of "No"
Change the placement of the second double quotes and use the ampersand &:
=IF(COUNTIF('ESU1'!D3:D50,"<"&DATE(2014,1,1)),"Yes","No")
If <date(2014,1,1) is enclosed within the quotes as you currently have it, it is evaluated as text. Moving the quotes and using the ampersand separates the operator < and the DATE function, which is now evaluated, and now the COUNTIF will do a time comparison and not look for the text <date(2014,1,1).

Excel formula: If one thing, give answer; else, give one of two possible answers

I need a formula that will see if the cell contains the words "Daily" or "Weekly" and display a "0", and for anything else, it will check for the presence or absence of a date.
This is my first attempt. I assumed rather than checking specifically for a date, we can just check to see whether or not the cell is blank.
If so, I think this can be accomplished by using a nested IF formula. First we will check for the words "Daily" or "Weekly" then we will check that the cell is non-black.
Assuming the cell we want to check is A1, we can use this formula:
=IF(OR(A1="Daily",A1="Weekly"),0,IF(A1<>"",1,0))
The first IF statement checks for "Daily" or "Weekly" in cell A1 and populates whatever cell the formula is in with a 0 if either of those words are in cell A1. If cell A1 does not contain those words the next step is to check whether or not it is blank. If the cell is not blank (e.g. there is a date) a 1 is returned, otherwise a 0 is returned.
Try this
`
IF(OR(A1="", A1="DAILY", A1="Weekly", NOT(ISNUMBER(DATEVALUE(A1)))),0,1)
`
Remember to format Col A as "Text" data type

CountIf Statement

I'm trying to count the number of instances where a date is entered in a column in Excel. I can't seem to construct the right CountIf statement. I'm trying to count the number of times an instance a date is greater than or equal to 1/5/2015.
=COUNTIF(L:L, >="01/05/15")
I see two issues here
Enclose the comparison operator in quotes
Specify the date to compare to as a date not a string
Better yet put the comparison date in a cell (let's say A1). Formula becomes
=COUNTIF(L:L, ">=" & A1)
Formula:
=COUNTIF(L:L, ">=01/05/15")

Excel Vlookup Between Two Dates With Returning Multiple Data

Basicly i have a list of information and i need to be able to enter a start data in one cell and a end date in a different cell and then return all the dates between them.
eg.
input input
1/1/14 2/2/14
Return
Date Name
14/1/14 bob
17/1/14 bob2
20/1/14 bob3
Dont no if you can do this with vlookup or index and match but any help would be good
thanks all
Probably your best bet is an IF(AND) statement.
=IF(AND(G6>E6,G6<F6),TRUE)
Where G6 is the date you are checking, and E6 and F6 hold the date range. TRUE can be replaced with any value, including a reference to a different cell.

using a function inside an excel IF and use its return value

I use excel for my budget. The top row has the dates when I am paid. I wrote a function called Between which determines if the date I am suppose to pay a particular bill will occur within the timeframe specified in Between. If it does, it will fill the cell with the correct value, otherwise blank. The arguments for Between are Between([cell with start date],[number of days in period], [date to test is in the period],[value to fill cell if date in period]). So, say A1 has 9/1/2014. Between(A1,14,7,500) would put 500 in the cell since the 7th is between 9/1 and 9/15. If A1 was 9/20/2014, the cell would be blank since the 7th is not between 9/20 and 10/4.
I would like to check if Between returns a value vs a blank so I could fill empty cells with a 0 so I can sum up numbers in a row. Suppose I had this expression in a cell say B12:
=IF(ISBLANK(Between(A1,14,7,500),0,?) I want the ? to be the value of Between in the IF statement. How can I get the value of Between into the cell if Between does not return blank?
Just repeat it:
=IF(ISBLANK(Between(A1,14,7,500)),0,Between(A1,14,7,500))
The N function converts non-numbers to 0, so you could try:
=N(Between(A1,14,7,500))

Resources