+ Reply to Thread
Results 1 to 6 of 6

Adding number within a cell of text and numbers.

  1. #1
    Registered User
    Join Date
    03-02-2012
    Location
    Halifax, NS
    MS-Off Ver
    Excel 2010
    Posts
    20

    Adding number within a cell of text and numbers.

    Hello

    I have a spreadsheet that has a bunch of cells from E14:IT14 that contains various codes and i wish to add the number following a particular code and total it in JE12.

    The cells in E14:IT14 will contain various codes. I need a total when UBA shows up (a number will also follow UBA).

    Example:

    Column A
    UBA1 MFR1

    Column B
    UBA2

    Column C
    WBA

    I would like to have a running total in a cell (in this case 3). UBA will always be the first entry in the cell, if applicable.

    thanks
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    12-06-2011
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Adding number within a cell of text and numbers.

    To get a running total, you could put this formula in cell E18 and then copy it across

    =IF(LEFT(E14,3)="UBA",MID(E14,4,1)+0,0)+D18

    Basically, it looks to see if the first 3 characters are UBA, and if they are, it takes the 4th digit (your number value) and added it to the previous columns total to give your running total.

    LL

  3. #3
    Registered User
    Join Date
    12-06-2011
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Adding number within a cell of text and numbers.

    One quick note: The formula above would assume that the number after UBA is only going to be a single digit. If that's not the case, let me know the largest value you would see.

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Adding number within a cell of text and numbers.

    This regular formula sums the single digit following "UBA" in E14:I14
    =SUMPRODUCT(--MID(E14:I14&"UBA0",FIND("UBA",E14:I14&"UBA")+3,1))

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  5. #5
    Registered User
    Join Date
    03-02-2012
    Location
    Halifax, NS
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Adding number within a cell of text and numbers.

    Larry;

    It would be a single digit

    thanks for the quick reply

  6. #6
    Registered User
    Join Date
    03-02-2012
    Location
    Halifax, NS
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Adding number within a cell of text and numbers.

    Ron;

    Thanks for the quick reply.

+ 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