+ Reply to Thread
Results 1 to 4 of 4

Macro Help: Sum values in coloumn B falling between Text1 and Text2 in coloumn A

  1. #1
    Registered User
    Join Date
    01-22-2019
    Location
    Nova Scotia, Canada
    MS-Off Ver
    2007
    Posts
    22

    Macro Help: Sum values in coloumn B falling between Text1 and Text2 in coloumn A

    Good evening,

    I have a bunch of worksheets with similar data-tables to the image below (albeit they are larger data sets). Can someone help me with a macro that sums the values in column B falling between rows i and k where cell Ai = text1 and cell Ak = text2? I don't want to include cells Bi and Bk in the sum, so the sum is essentially the Range("B" & (i+1) : "B" & (k-1)).

    The catch is, I want to be able to use this macro on any worksheet, so text1 and text2 won't always be in the same row (they will always be in column A however).

    table example.PNG

    Thanks a million!

    M

  2. #2
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    817

    Re: Macro Help: Sum values in coloumn B falling between Text1 and Text2 in coloumn A

    Try this:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-22-2019
    Location
    Nova Scotia, Canada
    MS-Off Ver
    2007
    Posts
    22

    Re: Macro Help: Sum values in coloumn B falling between Text1 and Text2 in coloumn A

    Wow, that was fast! Thanks Akuini

  4. #4
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    817

    Re: Macro Help: Sum values in coloumn B falling between Text1 and Text2 in coloumn A

    You're welcome, glad to help, & thanks for the feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Vlookup returning first row coloumn data and not comparing rest of coloumn
    By Brapp2Smokin in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 06-26-2018, 08:24 PM
  2. Replies: 6
    Last Post: 03-12-2015, 01:35 AM
  3. [SOLVED] Count each unique value in coloumn 'a' and sum values in coloumn 'b'
    By vipin717 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 05-06-2014, 05:25 AM
  4. Look up 2 coloumn and retunr the multiple values
    By kiranmayi16 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-31-2014, 02:29 PM
  5. [SOLVED] If value is text1, put text2 in new cell
    By Lis7 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-24-2012, 10:36 PM
  6. Excel 2007 : Text1 or text2 or blank in a cell
    By Rober in forum Excel General
    Replies: 1
    Last Post: 01-28-2010, 10:33 PM
  7. count cells that have *text1* and don't have *text2*
    By amntre in forum Excel General
    Replies: 1
    Last Post: 04-06-2005, 08:06 AM

Tags for this Thread

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