# IF function failing to create blank due to formula

#### Glenjamin

##### New Member
Hi,

I'm working with formula

=IF(Finance2!D15<>"",Finance2!D14,"")

So if there is data in D15 (Column actual) , D14 (target) value is used. If not it remains blank. Its basically creating a cumulative total as row 15 has a target every month already entered for the year, so the cell i have this typed in to will remain blank until such times as the next actual is typed in.

I have this working for the whole document bar this one particular sheet. The reason I believe it is working in other cases is the data being pulled is being typed in the other sheets. In this finance2 doc the data here is being pulled from a separate workbook. This appears to be making cell D15 appear to always have data in it even though the cell itself is blank, as obviously it has a formula linking to another workbook? This means the cumulative total is filling in for the whole year even though visually the 'actual' cell is empty.

Any help would be much appreciated.

Glen

Last edited:

### Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

#### JackDanIce

##### Well-known Member
Try:
Code:
``=IF(LEN(TRIM(Finance2!D15))>0,Finance2!D14,"")``

#### Glenjamin

##### New Member
Try:
Code:
``=IF(LEN(TRIM(Finance2!D15))>0,Finance2!D14,"")``
Thanks for that. I had to change the formula to =IF(LEN(TRIM(Finance2!D15))>4,Finance2!D14,""

I'm unsure why that alteration was required?

Cheers,

Glen

#### JackDanIce

##### Well-known Member
Without seeing your sheet, no idea I'm afraid, but glad you have it resolved