+ Reply to Thread
Results 1 to 5 of 5

If column A contains X, total value Y in column B

  1. #1
    Registered User
    Join Date
    09-28-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    If column A contains X, total value Y in column B

    Hi

    I'm trying to create a new spreadsheet to detail my expenses for the year. I can't upload an example because I'm at work and it won't allow. So, I'll try and explain.
    Column A is transaction date, Colum B is statement month, Column D is the expense reason and column E is the amount (forget C for now). In column G I've got the months of the year, Jan-Dec listed in cells 2-13. What I want is for in column H, cell 2 (next to January) it to total all the vlaues in column E that relate to January's statement. The statement date is in column B, as mentioned.

    Hope that makes sense and appreciate help.

    Secondly, Pretty well the same as the above but I want it to total the reason totals. So, coulmn D shows the reason, column I lists them (similar to the months) and column J I want to add the total values from column E that relate to that reason category stated in column D.

    Finally and not essentially, my card statements are from the 11th-10th monthly. So, If I buy something on 5th February, that counts on January's statement. Now obviously I can enter the statement month manually in column B. But I wondered if it's possible for column B to calcualte the statement month based on the transaction date entered in column A.

    all help much appreciated.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,627

    Re: If column A contains X, total value Y in column B

    Upload example workbook

  3. #3
    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: If column A contains X, total value Y in column B

    Hi

    Regarding this..

    ....I can't upload an example because I'm at work and it won't allow. So, I'll try and explain....
    Try this

    In H2

    =SUMPRODUCT((MONTH($A$2:$A$10)=MONTH(G2))*($E$2:$E$10))

    In J2

    =SUMPRODUCT(($D$2:$D$10=I2)*($E$2:$E$10))

    3) i don't understand the third request.

    Hope to helps you.
    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.

  4. #4
    Registered User
    Join Date
    09-28-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: If column A contains X, total value Y in column B

    Hi Fotis

    thanks for response - the second one works! the first answer returns the #VALUE!

  5. #5
    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: If column A contains X, total value Y in column B

    Hi

    Attached Files Attached Files

+ 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