+ Reply to Thread
Results 1 to 17 of 17

If formula- can anyone help?

Hybrid View

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

    If formula- can anyone help?

    i'm having an utter nightmare remembering how to solve this

    i have the following

    value being a, date from b and date to c

    Value  Date From     Date to
    £5000   30/04/08    31/09/08
    £2450   30/09/08    30/10/08
    £7500   14/03/09    23/05/09
    £9000   22/03/08    31/06/09
    i wanna have a formula that works out how much relates to

    07/08 year - being 01/04/07 to 31/03/08 say in column d
    08/09 year - being 01/04/08 to 31/03/09 in e
    and 09/10 year - being 01/04/09 to 31/03/10 and f

    i'm sure i've done summat like this before and know that it will involve working out the values per day to start with

    can anyone help?
    Attached Files Attached Files
    Last edited by Smiler; 02-09-2010 at 03:56 PM.

  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 formula- can anyone help?

    Try

    =Sumif(B:B,">=01/04/07",A:A)-Sumif(B:B,">31/03/08",A:A)
    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
    Huddersfield, England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: If formula help

    i've put an example of the spreadsheet up to show what i mean, hopefully it'll help

  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 formula help

    Not sure how you got your example results? What are you matching up?

    My assumption is:

    =SUMIFS($A$4:$A$7,$B$4:$B$7,">="&E$1,$C$4:$C$7,"<="&E$2) in E4 and copied down and across.

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

    Re: If formula help

    Quote Originally Posted by NBVC View Post
    Not sure how you got your example results? What are you matching up?

    My assumption is:

    =SUMIFS($A$4:$A$7,$B$4:$B$7,">="&E$1,$C$4:$C$7,"<="&E$2) in E4 and copied down and across.
    if you look at the values then it shows that the dates that value relates to in columns b and c (between these 2 dates)

    in columns e, f and g i want to show how much of these values related to the period

  6. #6
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: If formula help

    If you edited your Original Post with an attachement (I guess), then this is confusing.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

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

    Re: If formula help

    Quote Originally Posted by rwgrietveld View Post
    If you edited your Original Post with an attachement (I guess), then this is confusing.

    yeah i've put an attachment in original post

    in the example of the £7500

    1821.43 relates to the 08/09 year and 5678.57 relates to 09/10

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

    Re: If formula help

    Quote Originally Posted by Smiler View Post
    yeah i've put an attachment in original post

    in the example of the £7500

    1821.43 relates to the 08/09 year and 5678.57 relates to 09/10
    if i use this example

    the 7500 relates to 70 days in total

    17 of these days fall into the period 01/04/08 to 31/03/09
    and 53 of these days fall into the period 01/04/09 to 31/03/10

  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 formula help

    I am confused on how you get this fractional amount?

  10. #10
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: If formula help

    I came up with this in E4. Drag Right and Down.

    =$A4*(MIN($C4-$B4,MAX(0,E$2-$B4))/($C4-$B4)-MIN($C4-$B4,MAX(0,E$1-$B4))/($C4-$B4))
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: If formula help

    Small correction
    =$A4*(MIN($C4-$B4,MAX(0,1+E$2-$B4))/($C4-$B4)-MIN($C4-$B4,MAX(0,E$1-$B4))/($C4-$B4))
    Otherwise it come 1 day short. The TO date is including that day!

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

    Re: If formula help

    Quote Originally Posted by rwgrietveld View Post
    I came up with this in E4. Drag Right and Down.

    =$A4*(MIN($C4-$B4,MAX(0,E$2-$B4))/($C4-$B4)-MIN($C4-$B4,MAX(0,E$1-$B4))/($C4-$B4))

    many thanks - that looks good

    i'll have a look

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

    Re: If formula help

    shoot - just realised i've made an error in original post

    there is 71 days between 14/03/09 and 23/05/09

    so 08/09 should equal 1901.41 and 09/10 should be 5598.59

    excel seems to miss a day off

  14. #14
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: If formula- can anyone help?

    Excel or you? Both dates are at 00:00

    14/03/09 00:00 and 23/05/09 00:00

    There are 70 days in between !! If you like to include 23/05 then this would be 24/05/09 00:00 which is the same as 23/05/09 24:00

    14/03/09 -14/03/09 = 0 and not 1
    Last edited by rwgrietveld; 02-09-2010 at 05:06 PM.

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

    re: If formula- can anyone help?

    both me and excel

    if you look at your example you attached

    1821.43 + 5571.43 is 7392.86 and not 7500

  16. #16
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: If formula- can anyone help?

    therefore I posted a correction

    =$A4*(MIN($C4-$B4,MAX(0,1+E$2-$B4))/($C4-$B4)-MIN($C4-$B4,MAX(0,E$1-$B4))/($C4-$B4))

  17. #17
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: If formula- can anyone help?

    Another approach is to make 08/09 being 01/04/08 till 01/04/09.

    This would be my preference

+ 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