+ Reply to Thread
Results 1 to 4 of 4

Thread: Conditional Calculation

  1. #1
    Registered User
    Join Date
    09-20-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Exclamation Conditional Calculation

    Hi

    I am hoping you will be able to help me. I am looking to create a conditional calculation. Below is some example data;

    Product Code Description Sales Week Number
    001AAAA Mountain Bike Non Painted 100 25
    001BBBB Mountain Bike Painted Red 50 25
    001CCCC Mountain Bike Painted Blue 75 25
    002AAAA Racing Bike Non Painted 100 25
    002BBBB Racing Bike Painted Red 50 25
    002CCCC Racing Bike Painted Blue 75 25
    SD001AAAA Saddle 45 25
    HD001AAAA Handle Bars 66 25

    The calculation I want to create is to add the sales of all products that begin with the same number and divide that by the week number. So 001AAAA, 001BBBB and 001CCCC are added together and then divided by the week number, but only on products that end with AAAA. On products that don't end with AAAA the calculation should divide the sales of that product by week number only, and I also need it to divide the sales by week number on any product that begins with a letter.

    I hope this makes sense, and you are able to help

    Regards

    Paul Moss
    Last edited by paulmoss; 01-13-2012 at 09:52 AM. Reason: Solved

  2. #2
    Forum Guru TMShucks's Avatar
    Join Date
    07-15-2010
    Location
    Manchester, England
    MS-Off Ver
    MSO 2003 & 2007
    Posts
    6,224

    Re: Conditional Calculation

    One way:

    =SUMPRODUCT(--(LEFT($A$2:$A$9,3)=LEFT($A2,3)),--($C$2:$C$9))


    Regards, TMS

  3. #3
    Forum Moderator Richard Buttrey's Avatar
    Join Date
    02-15-2008
    Location
    Grappenhall, UK
    MS-Off Ver
    Excel for Windows & Mac - all versions.
    Posts
    6,566

    Re: Conditional Calculation

    Hi Paul,

    Does the attached help

    First extract a unique list of codes in column E to column H using Data Filter Advanced then copy I2:J2 down as far as necessary. These are your summary numeric & AAAA codes. The other individual sums are in column F
    Attached Files Attached Files
    Richard Buttrey

    If this was useful then please rate it appropriately.

    Click the small star icon at the bottom left of my post.

  4. #4
    Registered User
    Join Date
    09-20-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Conditional Calculation

    Thanks for the prompt response that looks like it will work a treat.

+ 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.2.0