If formula

H

hmsawyer

This formula is not working. Can you please help me correct it?

=IF(AND('Employee Attendance'!3:3>DATEVALUE("4/1/08"),'Employee
Attendance'!3:3<DATEVALUE("4/31/08")),"","Yes")

If any cell in the line has a date of 4/1/08-4/31/08 entered, then I need it
to return as blank. If false (no date in that range), then I want it to
return "Yes".


Thank you.
 
M

Mike

Try this.
=IF(AND('Employee Attendance'!3:3>DATEVALUE("4/1/2008"),'Employee
Attendance'!3:3<DATEVALUE("4/31/2008")),"","Yes")
 
P

Pete_UK

Try it this way:

=IF(COUNTIF('Employee Attendance'!3:3,">"&DATE(2008,4,1)) -
COUNTIF('Employee Attendance'!3:3,">"&DATE(2008,4,30))>0,"","Yes")

Hope this helps.

Pete
 
H

hmsawyer

That is better, but it is only returning Yes even when there are dates in
April in the line.

Any other thoughts?
 
P

Pete_UK

I suppose you are getting "Yes" with dates of 1st April? You need to amend
the first part of the formula so that it is ">=", i.e.:

=IF(COUNTIF('Employee Attendance'!3:3,">="&DATE(2008,4,1)) -
COUNTIF('Employee Attendance'!3:3,">"&DATE(2008,4,30))>0,"","Yes")

It would be a bit easier to modify for other months if you change it further
to this:

=IF(COUNTIF('Employee Attendance'!3:3,">="&DATE(2008,4,1)) -
COUNTIF('Employee Attendance'!3:3,">="&DATE(2008,5,1))>0,"","Yes")

i.e. the first date is the 1st of the month you are interested in, the
second date is the first of the next month, and both COUNTIFs are now
looking at ">=" the date.

Hope this helps.

Pete
 
H

hmsawyer

That works! Thank you so much!!!!

Pete_UK said:
I suppose you are getting "Yes" with dates of 1st April? You need to amend
the first part of the formula so that it is ">=", i.e.:

=IF(COUNTIF('Employee Attendance'!3:3,">="&DATE(2008,4,1)) -
COUNTIF('Employee Attendance'!3:3,">"&DATE(2008,4,30))>0,"","Yes")

It would be a bit easier to modify for other months if you change it further
to this:

=IF(COUNTIF('Employee Attendance'!3:3,">="&DATE(2008,4,1)) -
COUNTIF('Employee Attendance'!3:3,">="&DATE(2008,5,1))>0,"","Yes")

i.e. the first date is the 1st of the month you are interested in, the
second date is the first of the next month, and both COUNTIFs are now
looking at ">=" the date.

Hope this helps.

Pete
 
H

hmsawyer

This works, but now I think it would be better if instead of all the cells
saying "yes" now, only to go to yes after the end of that particular month.

So it would remain blank until 5.1.08, at which time the data would
automatically populate for April. (I changed the blank for a false arguement
to "no".)

Thanks again for all of your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top