Originally Posted by
scott.s.fower
...my way is still better...
First, I think you have misinterpreted the problem that krisarmstrong is trying to solve. Please see post #7 and the attachment there. The example in the OP, and solution you provided, use the same range of begin/end dates for every column. But in looking at the worksheet it is clear that each column represents data for a different week, and so each column in "Counts" should be looking at a different range of dates. There is not much point in having exactly the same counts repeated in every column. This is a gap in the original description, although krisarmstrong has not returned to the thread to comment on that.
Second, even if the interpretation were correct, and if we use your method of putting the begin and end dates into special cells, it is still possible to solve this without using a helper column. I would disagree that a helper column is better if you can use straightforward formulas that work without them. For example, in B7 you could use this formula without a helper column:
=COUNTIFS(AirCheck!$C:$C, $A7, AirCheck!$G:$G,">=" & H$1, AirCheck!$G:$G, "<" & J$1)
Third, even if the interpretation were correct, and you use a helper column, there is an error in your solution. Your formula in column H of sheet AirCheck produces only 1 TRUE result, and it's for 12/06/12. Clearly that date is not in the range 10/7/12-10/24/12 and all the other dates that are in that range are flagged FALSE. Your formula in H2 is
=AND(Counts!H1<=G2,G2<=Counts!J1)
It works fine in H2 but when copied down to all rows, the row references for the H and J cells in Counts also increment. The incorrect formula in H27, for example, is
=AND(Counts!H26<=G27,G27<=Counts!J26)
The correct formula for H2 is
=AND(Counts!$H$1<=G2,G2<=Counts!$J$1)
and can be copied down.
does excel know that that the string ie. 12/12/2012 is a date or will it assume it is a text string?
Excel does implied coercion. If it is being compared to a date it will be interpreted as a date, and if it is compared to a string it will be interpreted as a string.
Bookmarks