# Excel IF

##### Active Member
Hi

I have been racking my brains out on this for a almost a month, and am now in need of help!................

IF(D3>=DATE(1991,1,1),"",IF(E3>=DATE(1991,1,1),"")IF(F3="",(IF(E3="",DATEDIF(D3,DATE(1990,12,31),"d"),DATEDIF(E3,DATE(1990,12,31),"d"))),(IF(E3="",DATEDIF(D3,F3,"d"),DATEDIF(E3,F3,"d")))))

I realize that I have "IF" statements within "IF" statements BUT cannot get it to work........... I think I'm close.can anyone help thanks g

### Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

#### Oaktree

##### MrExcel MVP
Please explain what you'd like the formula to return

#### njimack

##### Well-known Member
Even without knowing what you're trying to achieve, I can see a duplication in your formula.

Replace
Code:
``IF(D3>=DATE(1991,1,1),"",IF(E3>=DATE(1991,1,1),"")``

with
Code:
``IF(OR(D3>=DATE(1991,1,1),(E3>=DATE(1991,1,1)),"")``

##### Active Member
Columns D E and F have Dates
Column N will be the year 1990 and Column O will 1991 etc etc until 2010

Column D and E are start Dates, Not all have a start date in Column E, so I need to check against that if no strt date in E then use strat date in D.

Column F is an end date .

What I am trying to accomplish is finding out the total amount of days between the start and end date, IF NO end date then assume Dec 31.

In the years columns I only want to report in "days" how many days, of course if in column F their is no end date I want to keep on counting those dates within each year.

End result I am attempting to accomplish, is over a 15 year period how many days experience PER YEAR

Eventually I will create an average when totaling Rows (about 150)

VBA is OK to if it works better, thnaks g

#### Oaktree

##### MrExcel MVP

I'm not too sure where columns N and O come in, but maybe this?

=DATEDIF(IF(E3="",D3,E3),IF(F3="",DATE(N\$3,12,31),F3),"d")

##### Active Member
Column N (the year 1990), will be where the formula resides, then repeated in Col. "O" through "AH"

tks g

##### Active Member
Ok .......not Ashamed to say NOW I'm not only lost I don't even know where I'm standing!

Formulas look good .....I just can't bring it all together........I know JUST A TINY TINY littl ebit more than how top open up Excel, but everything is self taught through frustrations like this!

HELP!!!!!!!

tk sg

Replies
2
Views
413
Replies
6
Views
430
Replies
3
Views
85
Replies
13
Views
306
Replies
9
Views
202

1,141,705
Messages
5,707,976
Members
421,539
Latest member
zuniBM

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back