Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Formula coding problem date value and text value

0

Hi, please would you be able to help clean up my spread sheet? I have a problem with this code (=IF(B$2>=C4,"Send Reminder","Not Required") It doesnt allow me to leave cells without data blank, i.e instead of a blank I still get "Send Reminder". Also I would like some code to clean me spreadsheet up, when using a static date and the current date you get a value, if one of those cells are blank the software still reads it as a number "0" which leads to a negative date value, leaving the spreadsheet looking messy until a date value is plugged in. It would be a massive help if you could lead me in the right direction or solve these issues with any spare time you have. much appreciated for any assistance.

Regards

Answer
Discuss

Answers

0
Selected Answer

The "right direction" certainly is to test a cell for content before you use its value. The simplest test is


=IF($C4="",[do nothing],[do whatever])

You may implement this test in your formula.

=IF($C4="","",IF($C4<B$2,"Send reminder","Not required"))

Instead of testing for null strings you can also test for zero and, of course, you may always reverse, such as testing for <>"" or non-zero.

Please observe that I reversed your logic of comparing C4 with B2. For better readability the variable should always be tested against the constant, writing the variable first.

Discuss

Discussion

I'm at dummy level so this help is greatly appreciated,
Cheers
Beat101 (rep: 2) Aug 13, '18 at 6:13 am
The best way to show appreciation is to mark the answer as "Accepted". Thank you.
Variatus (rep: 4889) Aug 13, '18 at 8:01 pm
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login