+ Reply to Thread
Results 1 to 9 of 9

Trouble combining nested IF / AND / OR function

  1. #1
    Registered User
    Join Date
    08-17-2020
    Location
    Leeds
    MS-Off Ver
    Microsoft 354 Apps for enterprise
    Posts
    6

    Question Trouble combining nested IF / AND / OR function

    I am trying to create a formula to support resource management.

    I have a start date and end date of an activity and want to spread the remaining resource equally between the two dates (dividing the Remaining Days between the Start and End Dates in monthly buckets). The formula below works well apart from when the start date and end date are in the same month. Any idea how I can fix this?

    =IF(AND(DATE(YEAR($E2),MONTH($E2),1)<=S$1,S$1<=EOMONTH($F2,0)),($J2/DATEDIF(DATE(YEAR($E2),MONTH($E2),1),$F2+15,"m")),0)

    Start Date = E2
    End Date = F2
    Remaining Days = J2
    Spread of Dates S2 - AJ2 (monthly buckets from July 2020 through to Dec 2021)

    Example spreadsheet attached.

    Any help gratefully received!!!
    Thank you!
    Jane
    Attached Files Attached Files
    Last edited by Jane Huddleston; 08-17-2020 at 06:18 AM. Reason: Adding attachment

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Trouble combining nested IF / AND / OR function

    Perhaps post a small sample sheet ? ( see yellow banner)

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Trouble combining nested IF / AND / OR function

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Quang PT

  4. #4
    Registered User
    Join Date
    08-17-2020
    Location
    Leeds
    MS-Off Ver
    Microsoft 354 Apps for enterprise
    Posts
    6

    Re: Trouble combining nested IF / AND / OR function

    Just added! Many thanks

  5. #5
    Registered User
    Join Date
    08-17-2020
    Location
    Leeds
    MS-Off Ver
    Microsoft 354 Apps for enterprise
    Posts
    6

    Re: Trouble combining nested IF / AND / OR function

    Just added! Many thanks

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,559

    Re: Trouble combining nested IF / AND / OR function

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I noticed that the sum of S2:AJ2 isn't the same as the value in J2 even before I changed the formula, however post #1 states that "he formula below works well apart from..." so I didn't make any change based on row 2.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Registered User
    Join Date
    08-17-2020
    Location
    Leeds
    MS-Off Ver
    Microsoft 354 Apps for enterprise
    Posts
    6

    Re: Trouble combining nested IF / AND / OR function

    Many thanks for this!! Works a treat :-)

    Thank you!
    Jane

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,559

    Re: Trouble combining nested IF / AND / OR function

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

  9. #9
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Trouble combining nested IF / AND / OR function

    Nice to hear it works! To make thing better:

    DATE(YEAR($E2),MONTH($E2),1)

    can be shortened by:

    E2-DAY(E2)+1

    or

    EOMONTH(E2,-1)+1

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. having trouble with nested IF function
    By Roydub83 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-11-2019, 01:55 AM
  2. Replies: 2
    Last Post: 01-05-2019, 03:33 AM
  3. Trouble with nested if function
    By faodavid in forum Excel General
    Replies: 2
    Last Post: 02-02-2015, 05:07 AM
  4. Trouble combining PRODUCT and IF function in same column
    By heatblocker10 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-22-2014, 12:11 PM
  5. Trouble with Nested IF Function
    By gvishnu in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-25-2013, 05:18 PM
  6. Having trouble combining AND and IF
    By hammerb in forum Excel General
    Replies: 2
    Last Post: 10-05-2011, 10:24 AM
  7. Trouble Combining Functions
    By jturenne in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-06-2009, 01:35 PM

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