+ Reply to Thread
Results 1 to 4 of 4

Conditional Calculation

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

    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 10:52 AM. Reason: Solved

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,465

    Re: Conditional Calculation

    One way:

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


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    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

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

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

    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.6.0 RC 1