+ Reply to Thread
Results 1 to 4 of 4

Traverse a colum match a text and return sum of all values in adjacent cells

  1. #1
    Registered User
    Join Date
    05-22-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    2

    Traverse a colum match a text and return sum of all values in adjacent cells

    Hi
    I am a new learner for excel and trying to solve following problem. Please help
    I have a table of format given below:

    A (name) B ($)
    Jay 10
    Kay 20
    Nay 30
    Jay 40
    Kay 50
    Pay 60

    I need to do find create another table showing how much total Jay , kay, nay, Pay ows ? For eg here Jay ows 50 (10+40) kay 70 (20+50) and so on.

    Any Help would be highly appreciated.

    Thanks

  2. #2
    Forum Contributor
    Join Date
    03-21-2012
    Location
    Ho Chi Minh city
    MS-Off Ver
    Excel 2003
    Posts
    180

    Re: You try with this macro

    PHP Code: 
    Sub GPE_COM()
     
    Dim Rng As RangeRws As Long
     
     Set Rng 
    = [A1].CurrentRegion:        Rws Rng.Rows.Count
     Rng
    (1).Resize(Rws).AdvancedFilter Action:=xlFilterCopyCopyToRange:=Range("D1"), Unique:=True
     
    [E1].FormulaR1C1 "=RC[-3]"
     
    [E2].FormulaR1C1 "=SUMIF(r" "C[-4]:R[" Rws "]C[-3],RC[-1],R" "C[-3])"
     
    [E2].AutoFill Destination:=Range("E2:E" Rws 2), Type:=xlFillDefault
     
    End Sub 
    Last edited by Sa DQ; 05-23-2012 at 10:55 PM. Reason: Corrected

  3. #3
    Registered User
    Join Date
    05-22-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: You try with this macro

    Thanks for replying Sa DQ.
    I tried your macro but i did not get any output. Not sure what is missing.
    It seems the macro runs without error but I do not see any values in column C and D. I am attaching my sheet also for reference
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    03-21-2012
    Location
    Ho Chi Minh city
    MS-Off Ver
    Excel 2003
    Posts
    180

    Re:Need the title of the fields

    See your file with macro after editing
    Attached Files Attached Files
    Last edited by Sa DQ; 05-23-2012 at 10:57 PM.

+ 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