+ Reply to Thread
Results 1 to 7 of 7

Help with Formula using Less than or Equal to

  1. #1
    Registered User
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel
    Posts
    17

    Help with Formula using Less than or Equal to

    Hi

    I seem to be struggling with using less than or equal to within a formula. I have attached a basic sheet showing what i am after.

    I use data from an SQL database to record monthly cost and wish to use excel to determine what the cost was to the end of one period and the end of the previous period.

    It seems that i cannot get it to work! Please help....

    Cheers

    Book3.xlsx

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Help with Formula using Less than or Equal to

    For Current period
    =SUMPRODUCT(--($A$7:$A$157<EOMONTH(A1,-1)),$B$7:$B$157)

    For previous period
    =SUMPRODUCT(--($A$7:$A$157<EOMONTH(A1,-2)),$B$7:$B$157)
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Help with Formula using Less than or Equal to

    Your sheet isn't working because you're converting the dates in cells A2 and A3 to text with the TEXT function. Just use the EOMONTH function on it's own.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  4. #4
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Help with Formula using Less than or Equal to

    Book3.xlsx

    Ciao,Innerise forse basta modificare formula A2 ed A3 .
    Vedi file

  5. #5
    Registered User
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel
    Posts
    17

    Re: Help with Formula using Less than or Equal to

    Hi

    Thanks.. That is perfect for doing the total split between periods. I missed out including the element that i need to break the cost down by, i have now included that in the attached.

    I will need to return the cost per line, if thats possible?

    Cheers

    Book3.xlsx

  6. #6
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Help with Formula using Less than or Equal to

    Current period
    =SUMPRODUCT(--($A$7:$A$157<EOMONTH($A$1,-1)),--($C$7:$C$157="Labour"),$B$7:$B$157)

    Adpat accordingly for previous period and other elements

  7. #7
    Registered User
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel
    Posts
    17

    Re: Help with Formula using Less than or Equal to

    Thanks to all of you... its all sorted (i feel a little sheepish as i should have guessed it was a formatting error)... the sum product formula will also help a lot..

    Brilliant, thanks again

+ 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