Tech Support Guy banner
Status
Not open for further replies.
1 - 5 of 5 Posts

·
Registered
Joined
·
2 Posts
Discussion Starter · #1 ·
I hope you can help me with a fairly simple formula, but if formulas are really hard for me.
I want to put the work PAID in Cell b if Cell c has a date in it, otherwise I want it blank. Thanks in advance for your help.:confused:
 

·
Registered
Joined
·
13 Posts
What will be in cell C if it doesn't have a date, will it be blank?

If this is the case, try entering formula =IF (Cn = "","", "PAID") in cell B (n is the row number).

If cell C contains other information as well as a date, then the formula depends on what it can contain.
 

·
Registered
Joined
·
4,916 Posts
I am a little confused by what you are wanting. Are you simply wanting to check for a non-blank value in column C or are you wanting to validate whether the value is a true date or not? If you are are wanting actual date validation I don't believe that Excel has a built in function to check to see if the value is a date. You can create a user defined function though. Press ALT + F11 to bring up the VB editor and click INSERT --> MODULE and copy the code below into the blank module and re-save the workbook.

Code:
Public Function CheckDate(vCell As Range)

If IsDate(vCell) Then

CheckDate = True

End If

End Function
After creating the function you can use an IF statement with the user defined function you created to check for a date value in the cell. Place the following formula in your cell in column B and copy down for all other rows.

=IF(checkdate(C1),"TRUE","PAID","")

Regards,
Rollin
 

·
Registered
Joined
·
2 Posts
Discussion Starter · #4 ·
Thanks, Trevor, your formula is just what I was looking for. I appreciate the reply Rolliing_again but it was not all that involved. You guys are the greatest!!!:up:
 

·
Registered
Joined
·
5,458 Posts
Unfortunately, the only real way to check for an Excel recognized date is the way Rollin has shown you (much like this kb entry). If you check for ISNUMBER() you could get any ole number, not just a date, as dates are expressed as Serial Numbers in Excel. The only other thing you might add to the UDF is Application.Volatile to keep recalc up, but, if not needed I wouldn't suggest it, takes up a lot of resources in recalculating all the time.

HTH
 
1 - 5 of 5 Posts
Status
Not open for further replies.
Top