+ Reply to Thread
Results 1 to 9 of 9

IF / OR formula

  1. #1
    Registered User
    Join Date
    02-09-2010
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    6

    IF / OR formula

    could any help me with this formula, summary below of what i am trying to do.

    A B C D E F
    1 Name StartDate EndDate Jan-10 Feb-10 March-10
    2 Tom 3/1/10 31/12/10 1 1 1
    3 **** 2/2/10 31/10/10 0 1 1
    4 Harry 15/3/10 1/12/10 0 0 0

    Take D2
    it looks at d1 and see's if it falls between b2 and c2 if yes then shows 1 if not then shows 0

    any help would be greatly appreciated.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF / OR formula

    Try:

    =--AND(D$1>=$B2,D$1<=$C2)

    copied down and across
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    02-09-2010
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: IF / OR formula

    wow that was quick

    seems to work fine but i would expect to see a 1 in feb 10 but the ones' dont start until march. (for row 3)

    any ideas?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF / OR formula

    Are your dates in columns B and C entered properly as dates...

    Select column B and go to Data|Text to Columns and skip to 3rd window. Select Date from the column data format section and DMY from dropdown next to it.

    Repeat for column C.

    Does that fix it?

  5. #5
    Registered User
    Join Date
    02-09-2010
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: IF / OR formula

    nope done that still the same result, 0 in the feb column

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF / OR formula

    Here it is working for me
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-09-2010
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: IF / OR formula

    erm your row 4 'cell f4' should show 1 as the start date lands in march

  8. #8
    Registered User
    Join Date
    02-09-2010
    Location
    Wakefield, England
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: IF / OR formula

    this adaption takes into consideration any day within the month and converts your start/end dates to the first of the month, therefore being abl to compare to the month/year format of the columns

    =--(AND(V$8>=DATE(YEAR($D9),MONTH($D9),1),V$8<=DATE(YEAR($E9),MONTH($E9),1)))

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF / OR formula

    Your sample shows 0 in that spot..

    Maybe try:

    =--AND(EOMONTH($B2,-1)+1<=D$1,EOMONTH(D$1,0)<=$C2)

    copied across the table.

    Make your you have Analysis Toolpak addin installed (Tools|Addins)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1