Excel DateDif

I am using DateDif in Excel and getting an error, #NUM!
See Attached file.
I know it is because the date in Cell B1 occurs before the date in Cell A1.  However I have a long list of dates I need to calculate, is there a way to fix the formula so I don't have to rearrange the Column order?    Thanks for any help.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michael FowlerSolutions ConsultantCommented:
Hi, your attachment is missing but in answer to your question you could use the IfError  function to allow for this


For example


Open in new window

fjkaykr11Author Commented:

Thanks for your reply.  Sorry I didn't upload the file correctly.  I am going to attempt the file again.
When I tried your formula, I got an error with missing parenthesis, when I added another I still am getting an error.
Michael FowlerSolutions ConsultantCommented:
I think the problem was the extra spaces. Here is your example with the formula working


Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fjkaykr11Author Commented:
That works, thanks so much for the fast solution.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.