SUM only numbers in a cell that also contains text.

Palacemad

New Member
Hi, I'm sure this will be fairly straightforward for someone here...

I have a group of cells that I want adding together, they are cells G65, K65, O65 and S65.

Each one of these cells contains both text and numbers and I only want to add the number part of the cell. They all contain the same formatting, they say the word Achieved, have one space and then the number value.

I have looked at using SUMIF and ISNUMBER but all to no avail.

I would be very grateful if someone can point me in the right direction!

Thank you
 

Finalfight40

Board Regular
As the cells are all going to be formatted the same, you can try something like the below:

=SUM(RIGHT(G65,LEN(G65)-SEARCH(" ",G65)),RIGHT(K65,LEN(K65)-SEARCH(" ",K65)), RIGHT(O65,LEN(O65)-SEARCH(" ",O65)), RIGHT(S65,LEN(S65)-SEARCH(" ",S65)))
 

Finalfight40

Board Regular
Or:

=SUM(SUBSTITUTE(G65, "Achieved", ""), SUBSTITUTE(K65, "Achieved", ""), SUBSTITUTE(O65, "Achieved", ""), SUBSTITUTE(S65, "Achieved", ""))
 

Palacemad

New Member
Thank you! Th efforts option definitely works. Will try the second suggestion too as that appears to be more straightforward to understand what is going on.
 

Finalfight40

Board Regular
Happy it works for you.

The first option is just looking to the right of the space of each cell since you have a space before each number and the second option is just replacing the "Achieved" with nothing which leaves just the number.

Added the second option since i thought it looks a lot easier to change if needed.
 

Some videos you may like

This Week's Hot Topics

  • Get External Data (long shot question!)
    This is likely a long shot but I am wondering if it is at all possible for Excel to somehow 'change' the contents of a URL that is being linked to...
  • Importing multiple excel files into one spreadsheet
    Hi, I'm trying to import multiple excel files (with the same format into a single spreadsheet) so that each day's file is listed underneath the...
  • Cell Formatting
    Good Morning, I need to format a few different cells in the following manners: A1 has to always add a colon (:) after whatever is typed in by a...
  • How to copy multiple rows using If
    Hi all, I'm very new to VBA and have written this simple code to copy certain cells if a certain cell within that row contains any data. I need...
  • Workbook_Change stopped working !
    I am working on an app to speed up & automate processing of Credit Cards statements. After data is input from a CSV file, it is presented to the...
  • VBA If statement
    Dear All, I have two dates, where I'd like a message box to pop, if the dates are between this criteria. [CODE] sDate1 = #10/1/2019#...
Top