+ Reply to Thread
Results 1 to 8 of 8

IF Statement - Timing and Span of variable

  1. #1
    Registered User
    Join Date
    01-13-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    60

    IF Statement - Timing and Span of variable

    Hi,

    Refer attached. My goal is to spread the cost in B1 from the start date in C1 and span in D1. The result is where ever the cost starts, it evenly spans based on the number of months in D1 for the subsequent months.

    Any thoughts are greatly appreciated!

    PERE
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: IF Statement - Timing and Span of variable

    May be like this:
    Please Login or Register  to view this content.
    copy to the right until column O and copy down for more row
    Last edited by SDCh; 10-15-2013 at 05:40 AM. Reason: change formula and copy .....
    Click (*) if you received helpful response.

    Regards,
    David

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: IF Statement - Timing and Span of variable

    hi Pere. B1 is empty. i suppose you mean B6. C1 & D1 are empty too. i suppose you mean B2 & D6. so using those cell references, try this in E6:
    =IF(AND(E$2>=$B$2,E$2<=EOMONTH($B$2,$D6-1)),$B6/$D6,0)

    if i'm wrong about the cell references, match mine to where your cost, start date & Span are. also, it would be helpful to always manually key in what you're hoping to see

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Registered User
    Join Date
    01-13-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: IF Statement - Timing and Span of variable

    Apologies i should have stated the below cell references. The formula you have provided doesn't work if you change C6

    Refer attached. My goal is to spread the cost in B6 from the start date in C6 and span in D6. The result is where ever the cost starts, it evenly spans based on the number of months in D1 for the subsequent months.

  5. #5
    Registered User
    Join Date
    01-13-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: IF Statement - Timing and Span of variable

    above response was for SDCh

  6. #6
    Registered User
    Join Date
    01-13-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: IF Statement - Timing and Span of variable

    Thanks benishiryo....i'm still stuck. If I insert your formula, it works if C6 is a fixed month, however if it changes i.e. to month 2 your formula doesn't work?

  7. #7
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: IF Statement - Timing and Span of variable

    my solution was based on the idea the start date is B2 (a real date). i'm supposing C6 is going to be like what's in the file then? a month number that is in line with E4:O4? if that's so:
    =IF(AND(E$4>=$C6,E$4<=$C6+$D6-1),$B6/$D6,0)

    if C6 is going to be a real date, then:
    =IF(AND(E$2>=$C6,E$2<=EOMONTH($C6,$D6-1)),$B6/$D6,0)

  8. #8
    Registered User
    Join Date
    01-13-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: IF Statement - Timing and Span of variable

    Thanks Benishiryo.....=IF(AND(E$4>=$C6,E$4<=$C6+$D6-1),$B6/$D6,0) works well.

+ 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. [SOLVED] For Next Statement with If Statement Reducing Upper Variable
    By Break_Point in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-28-2013, 06:30 PM
  2. Variable averaging span question.
    By Anthony01803 in forum Excel General
    Replies: 3
    Last Post: 03-05-2010, 03:57 PM
  3. VB IF statement using a Variable
    By jonn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2007, 11:18 AM
  4. [SOLVED] Variable IF statement (in VBA)
    By Post Tenebras Lux in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2006, 10:35 AM

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