=IF(D4>C4,D4-C4,0) but if the cell c4 is blank the result should be blank or zero
in Other Math Topics by

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

This looks like Excel coding for a cell. A blank cell could be a blank text cell or a blank numerical cell. If the cell format has been specified by the user as a numerical cell, blank cell may be interpreted by Excel as 0. If the cell is unspecified or specified as a text cell, you cannot necessarily perform arithmetic on a text cell, unless the Excel version you are using interprets text data that looks like a number as a number. You cannot rely on this, and it's unsafe to do so. Other formats for the cell may also have a default meaning. For example, a blank date cell may be treated as 1/1/1900, and a numerical value of zero date may be inserted by default. If D4 is numerical and C4 is unspecified and blank, the software may well insert a blank for the cell carrying the IF function. Sometimes Excel will insert an error flag #VALUE? or something like that if it can't understand your intention and doesn't want to second guess any particular interpretation. To be absolutely certain everything is properly interpreted, the IF statement should make specific allowance for blank cells by testing for NULL or 0. The best solution is to experiment with a more concise and comprehensive conditional statement so that your are certain to cover all eventualities.

Even if this question doesn't relate to Excel, it looks like it is nevertheless coding for some application, and the same rule applies: make conditional statements precise so as to cover all eventualities. Never think that any software matches human reasoning!

by Top Rated User (1.2m points)

Related questions

1 answer
asked Mar 27, 2017 in Algebra 1 Answers by anonymous | 554 views
1 answer
1 answer
1 answer
asked Mar 21, 2014 in Algebra 1 Answers by chaithra | 1.0k views
Welcome to MathHomeworkAnswers.org, where students, teachers and math enthusiasts can ask and answer any math question. Get help and answers to any math problem including algebra, trigonometry, geometry, calculus, trigonometry, fractions, solving expression, simplifying expressions and more. Get answers to math questions. Help is always 100% free!
87,516 questions
100,279 answers
2,420 comments
732,015 users