+ Reply to Thread
Results 1 to 7 of 7

Simplify formula

Hybrid View

SalamanderSam14 Simplify formula 01-04-2012, 10:11 AM
Andy Pope Re: Simplify formula 01-04-2012, 10:17 AM
SalamanderSam14 Re: Simplify formula 01-04-2012, 10:31 AM
OnErrorGoto0 Re: Simplify formula 01-04-2012, 10:18 AM
SalamanderSam14 Re: Simplify formula 01-04-2012, 12:04 PM
adaws Re: Simplify formula 01-04-2012, 12:23 PM
OnErrorGoto0 Re: Simplify formula 01-04-2012, 12:20 PM
  1. #1
    Registered User
    Join Date
    01-04-2012
    Location
    Preston, England
    MS-Off Ver
    Excel 2010
    Posts
    49

    Simplify formula

    Hi i was wondering if anyone can help me shink this formula or make it so that i dont have to add another if statement if i want to increase my table

    =IF($D$4=D13,$G$4,0)+IF($D$5=D13,$G$5,0)+IF($D$6=D13,$G$6,0)+IF($D$7=D13,$G$7,0)+IF($D$8=D13,$G$8,0)+IF($D$9=D13,$G$9,0)+IF($D$10=D13,$G$10,0)+IF($D$11=D13,$G$11,0)+IF($D$12=D13,$G$12,0)+IF($D$13=D13,$G$13,0)+IF($D$14=D13,$G$14,0)+IF($D$15=D13,$G$15,0)+IF($D$16=D13,$G$16,0)+IF($D$17=D13,$G$17,0)+IF($D$18=D13,$G$18,0)+IF($D$19=D13,$G$19,0)+IF($D$20=D13,$G$20,0)+IF($D$21=D13,$G$21,0)+IF($D$22=D13,$G$22,0)+IF($D$23=D13,$G$23,0)+IF($D$24=D13,$G$24,0)+IF($D$25=D13,$G$25,0)+IF($D$26=D13,$G$26,0)+IF($D$27=D13,$G$27,0)+IF($D$28=D13,$G$28,0)+IF($D$29=D13,$G$29,0)+IF($D$30=D13,$G$30,0)

    Thanks

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Simplify formula

    =sumproduct((d4:d30=d13)*(g4:g30))
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    01-04-2012
    Location
    Preston, England
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Simplify formula

    Thanks alot, thats made that alot easier, both of those solutions worked
    Last edited by SalamanderSam14; 01-04-2012 at 10:39 AM.

  4. #4
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Simplify formula

    I think that is just:
    =SUMIF($D$4:$D$30,D13,$G$4:$G$30)
    Good luck.

  5. #5
    Registered User
    Join Date
    01-04-2012
    Location
    Preston, England
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Simplify formula

    If i wanted to change that formula to compare a range of dates instead of one value how would i go about it. For example get the sum for values entered in january 2011?

  6. #6
    Registered User
    Join Date
    09-26-2010
    Location
    A, A
    MS-Off Ver
    Excel 2003
    Posts
    86

    Re: Simplify formula

    let the cell D13 be the "month & year" you are looking for.... and use the same sumif function, or else in a separate column enter the months Jan 2011 to Dec 2011 and in the criteria field select the appropriate month, so ideally the formula would be =sumif(months range, selected month, sum range)...

  7. #7
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Simplify formula

    Either something like:
    =sumproduct((Year(d4:d30)=2011)*(month(d4:d30)=1)*(g4:g30))

    or
    =SUMIF($D$4:$D$30,">="&DATE(2011,1,1),$G$4:$G$30)-SUMIF($D$4:$D$30,">="&DATE(2011,2,1),$G$4:$G$30)

+ 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