+ Reply to Thread
Results 1 to 13 of 13

Calculating sales with respect to item and in a particular month

  1. #1
    Registered User
    Join Date
    07-18-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Calculating sales with respect to item and in a particular month

    Hi, I would like to ask, if A1:A100 are the types of products (e.g. "CD", "Book" and "Tape") and B1:B100 are the selling price of the respective item, what formula should I key in in cell C1 if I want it to show me the total sales of all the CDs only? (note that the CDs are all in different prices)

    In addition, if the items were bought over a 1 year period and D1:D12 are used to represent the 12 months, what formula should i have in E1 if I want to know the total sales of CDs for the month of Jan?

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Calculating sales with respect to item and in a particular month

    Hi

    Try

    1) =SUMIF(A1:A100,"CD",B1:B100)

    2)SUMPRODUCT((A1:A100="CD")*(MONTH(D1:D100=1))*(B1:B100))
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    07-18-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Calculating sales with respect to item and in a particular month

    Quote Originally Posted by Fotis1991 View Post
    Hi

    Try

    1) =SUMIF(A1:A100,"CD",B1:B100)

    2)SUMPRODUCT((A1:A100="CD")*(MONTH(D1:D100=1))*(B1:B100))
    Hi Fortis, thanks for your reply, I managed to get the first one right. But for the 2nd one, it came up with a #VALUE! error. Would you know what actually went wrong?

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Calculating sales with respect to item and in a particular month

    This?

    =SUMPRODUCT((A1:A100="CD")*(MONTH(D1:D100)=1)*(B1:B100))

  5. #5
    Registered User
    Join Date
    07-18-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Calculating sales with respect to item and in a particular month

    Quote Originally Posted by Fotis1991 View Post
    Hi

    Try

    1) =SUMIF(A1:A100,"CD",B1:B100)

    2)SUMPRODUCT((A1:A100="CD")*(MONTH(D1:D100=1))*(B1:B100))
    Hi Fortis, I managed to get the 2nd eqn to work similarly to the 1st eqn. It will correctly select those with "CD" but irregardless of the month of the year. Would you know what actually went wrong?

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Calculating sales with respect to item and in a particular month

    Did you see my post number 4?

  7. #7
    Registered User
    Join Date
    07-18-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Calculating sales with respect to item and in a particular month

    Quote Originally Posted by Fotis1991 View Post
    Did you see my post number 4?
    Oh I missed it. Managed to get it already. Many thanks. =)

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Calculating sales with respect to item and in a particular month

    You are welcome

  9. #9
    Registered User
    Join Date
    07-18-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Calculating sales with respect to item and in a particular month

    Hi Fotis, one more question on this topic. How would the formula change if the data spans over several years and I want to know the sales for CDs for each month and year?

    I got this formula from another spreadsheet, can I use it?

    =SUMPRODUCT(--(Investment!$B$3:$B$602>=$A3), --(Investment!$B$3:$B$602<DATE(YEAR($A3),MONTH($A3)+1,1)), Investment!F$3:F$602)

  10. #10
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Calculating sales with respect to item and in a particular month

    Maybe

    =SUMPRODUCT((A1:A100="CD")*(MONTH(D1:D100)=1)*(year(d1:d100)=2012)*(B1:B100))

    For year 2012.

    Or else, pls upload your sample workbook.

  11. #11
    Registered User
    Join Date
    07-18-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Calculating sales with respect to item and in a particular month

    Hi Fotis, apologies for the late reply. I am unable to upload the file but i roughly know what had gone wrong. Lets say I have a E1:E100 showing the months and years from 2010 to 2012 and I want the corresponding CD sales for each of the months in F1:F10, what should I replace # with in the formula below so that I can achieve that without having to type the months and years out manually?

    =SUMPRODUCT((A1:A100="CD")*(MONTH(D1:D100)=#)*(year(d1:d100)=#)*(B1:B100))

  12. #12
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Calculating sales with respect to item and in a particular month

    Hi

    As you are unable to upload your sample workbook, it is too difficult...But one more try...
    .... for each of the months in F1:F10,
    These are 10 months. Not 12!

    So from F2:F13, type the numbers of the months(1,2,3.......)

    In G1=2010, in H1=2011, in I1=2012

    In G2 and copy accross and down, put this.

    =SUMPRODUCT(($A$1:$A$100="CD")*(MONTH($E$1:$E$100)=$F2)*(YEAR($E$1:$E$100)=G$1)*($B$1:$B$100))

  13. #13
    Registered User
    Join Date
    07-18-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Calculating sales with respect to item and in a particular month

    Got it! Thanks alot Fotis! =)

+ 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