+ Reply to Thread
Results 1 to 6 of 6

Sum if cell contains text string

  1. #1
    Registered User
    Join Date
    06-30-2014
    Location
    Frankfurt
    MS-Off Ver
    2010
    Posts
    7

    Sum if cell contains text string

    Hi guys,

    below is the code I started:

    Please Login or Register  to view this content.
    The range contains a list of names. I want the sub to start with the first name and sum the value(long) which are in 7 columns to the left of the text string. Once this procedure has been done for the first name, it should go back up to the second name and do the same and so on. Once done I will return the name (cell A1 in another sheet) and its respective sum (cell B1 in another sheet) so that I have the list of names with their respective sum.
    Could you help on the sum function using an offset of 7 columns to the left?

    Thanks!!!

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Sum if cell contains text string

    I dont think you need the cell.offset in ""'s also it should be offset from ParentCompany as you are not using a var called cell

    something like

    Please Login or Register  to view this content.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    06-30-2014
    Location
    Frankfurt
    MS-Off Ver
    2010
    Posts
    7

    Re: Sum if cell contains text string

    I can directly select the range this is not really an issue. The sub currently does not select the text strings in the range one by one. Instead it takes them all at the same time and performs the total sum of the other range...

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Sum if cell contains text string

    sorry i dont understand what you want, your post says "Could you help on the sum function using an offset of 7 columns to the left?"

  5. #5
    Registered User
    Join Date
    06-30-2014
    Location
    Frankfurt
    MS-Off Ver
    2010
    Posts
    7

    Re: Sum if cell contains text string

    This is what I am looking for

    "For each unique text string in the RangeParentCompany, select the corresponding number which is 7 columns to the left of the text string
    'then reiterate the task till you are down in the range by summing all the numbers. Start again with a new text string"

  6. #6
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Sum if cell contains text string

    Well you dont need sum then, you just need parentcompany.offset(0,7).value

    are you asking for someone to advise on doing the Unique bit of your list?

+ 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. [SOLVED] IF range of cells contains string of text, return contents of cell where string is found
    By nobodyukno in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-03-2013, 09:56 AM
  2. [SOLVED] Find partial text string within another text string return original text into cell.
    By mikey42979 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-17-2013, 02:58 PM
  3. Replies: 8
    Last Post: 08-07-2012, 10:15 AM
  4. Replies: 9
    Last Post: 10-17-2011, 04:33 PM

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