MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old Dec 31st, 2003, 11:15 AM   #1
spendloa
 
Join Date: Jan 2003
Posts: 56
Default IF, AND, OR?

Good morning all...

Column C always holds a date and column D may (or may not) hold a date. Column E shows a number of days. What I would like to do is something like this:

Return a "1" -- if there is a date in culumn D (this should be checked first) AND the month in D = 1 AND E>8 OR if there is no date in culumn D AND the month in C = 1 AND E>8 -- otherwise return a "0"

I have this and can't work out what is wrong with it:

=IF(AND(MONTH(D5)=1,E5>8),1,IF(MONTH(D5)="",(IF(AND(MONTH(C5)=1,E5>8),1,0)),0))

It keeps returning 1's where they shouldn't be.

As usual, your assitance very much apprecated.
Happy new year!
Al
spendloa is offline   Reply With Quote
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT +1. The time now is 03:18 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 by MrExcel Consulting.