+ Reply to Thread
Results 1 to 9 of 9

Logic formula for calculating between two dates

  1. #1
    Registered User
    Join Date
    11-22-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    26

    Question Logic formula for calculating between two dates

    I need to calculate some construction costs using a reference table provided on another tab.

    I'm trying to use the IF(AND) function to determine if the current month is between the two months of construction, and if so, use the vlookup function to find the construction costs and multiply them by the costs and % ownership, otherwise, have it equal to zero.

    I have included the formula I am using-- am I missing something here? What can I do to fix this? Thanks so much!


    =if(and(G6>=$A$7,G6<=$C$7),vlookup($B$4,'Reference Tables'!$K$2:$W$7)*$F$7*$D$8),0))

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Logic formula for calculating between two dates

    You miss what column to return with VLOOKUP function:

    vlookup($B$4,'Reference Tables'!$K$2:$W$7, 3, FALSE)

  3. #3
    Registered User
    Join Date
    11-22-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Logic formula for calculating between two dates

    I'll give it a try...thanks!

  4. #4
    Registered User
    Join Date
    11-22-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Logic formula for calculating between two dates

    Didn't seem to work. Are there some sort of logic formula limitations when it comes to dates?

    I'm not too familiar with this.

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Logic formula for calculating between two dates

    Can yoiu upload example workbook?

    (Also, 3 was just an example).

  6. #6
    Registered User
    Join Date
    11-22-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Logic formula for calculating between two dates

    Yes, I finally figured it out...thanks!

  7. #7
    Registered User
    Join Date
    06-25-2013
    Location
    united states
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Logic formula for calculating between two dates

    Im trying to work with a formula that it nesting, here is the formula I can currently working with,

    =IF(AND(AB2>=$J$6,AB2<=$K$6),IF($J$6=AB2,$M$6*0.25*$L$6,IF($J$6+1=AB2,$M$6*0.5*$L$6,0)*0),"0")

    I think where im going wrong is the "$J$6+1=AB2" section. All im trying to do with the 6+1 feature is take my J6 cell (which is first month of production) and move onto the next cell which will change multiplication of .25 to .50, any advice on how to get this to work?

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Logic formula for calculating between two dates

    R3CON3D,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  9. #9
    Registered User
    Join Date
    06-25-2013
    Location
    united states
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Logic formula for calculating between two dates

    opps im sorry I was not aware of that, ty!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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