ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Make cells blank IF (https://www.excelbanter.com/excel-programming/436376-make-cells-blank-if.html)

RC

Make cells blank IF
 
I have a formula as below, but want the cell to be blank (and not show the
words #Value!) if there is no data in a preceeding cell, say cell H2. How do
I do this?

=DATEVALUE(LEFT(G2,4)&"/"&MID(G2,5,2)&"/"&RIGHT(G2,2))+TIMEVALUE(LEFT(H2,2)&":"&RIGHT(H2,2 ))

This way the formula only gets enacted if a value is in the preceeding cell
and the spreadsheet looks a lot cleaner.

Many thanks

Eduardo

Make cells blank IF
 
Hi,
=if(H2="","",your formula)

"RC" wrote:

I have a formula as below, but want the cell to be blank (and not show the
words #Value!) if there is no data in a preceeding cell, say cell H2. How do
I do this?

=DATEVALUE(LEFT(G2,4)&"/"&MID(G2,5,2)&"/"&RIGHT(G2,2))+TIMEVALUE(LEFT(H2,2)&":"&RIGHT(H2,2 ))

This way the formula only gets enacted if a value is in the preceeding cell
and the spreadsheet looks a lot cleaner.

Many thanks


Jacob Skaria

Make cells blank IF
 
=IF(H2="","",DATEVALUE(.........))

OR

=IF(OR(G2="",H2=""),"",DATEVALUE(.........))

Replace DATEVALUE(.........) with your formula

If this post helps click Yes
---------------
Jacob Skaria


"RC" wrote:

I have a formula as below, but want the cell to be blank (and not show the
words #Value!) if there is no data in a preceeding cell, say cell H2. How do
I do this?

=DATEVALUE(LEFT(G2,4)&"/"&MID(G2,5,2)&"/"&RIGHT(G2,2))+TIMEVALUE(LEFT(H2,2)&":"&RIGHT(H2,2 ))

This way the formula only gets enacted if a value is in the preceeding cell
and the spreadsheet looks a lot cleaner.

Many thanks



All times are GMT +1. The time now is 04:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com