+ Reply to Thread
Results 1 to 4 of 4

How do I SUM cells containing text and numbers within a range.

  1. #1
    Registered User
    Join Date
    03-14-2009
    Location
    Leeds
    MS-Off Ver
    Excel 2010
    Posts
    6

    Talking How do I SUM cells containing text and numbers within a range.

    Hi everyone
    I have an array containing work done per client referenced by date and time (see attachment).
    Below the array, I have columns containing the related client details, e.g.
    A=Client name
    B=Client code (this is linked to the array codes)
    C=Hourly rate
    D=Units (calculated from the array)
    E=Hours worked (calculated)
    F=Amount due (calculated)

    My problem is that I am now starting to have clients with a variable hourly cost, so column "C" (hourly rate) is no longer a constant.
    These variable rate clients are recognized by a client code beginning with "V". The hourly rate for these clients is found in the array, e.g.
    VPJ0020 = Client code "VPJ" with a rate for this period of NT$20 per 15 mins
    VPJ0030 = Client code "VPJ" (the same client) with a rate for this period of NT$30 per 15 mins

    The client code for this one is "VPJ", and the amount due should be 20+30=50

    My question:
    How do I calculate the amount due from these 'variable rate' clients (highlighted in blue)?

    My thoughts:
    I need to locate the cells containing the 3 character variable client prefix (e.g. "VPJ") and then SUM the remaining 4 digits to find the working values.

    I've tried using LEFT, MID, ISNUMBER, and SUBSTITUTE to try to extract the numeric value when SUMming the range, but I couldn't get it to work.

    It was a really interesting problem until I ran out of options!


    Any help would be appreciated.

    Thank you
    Attached Files Attached Files
    Last edited by l1velife; 09-23-2013 at 01:08 AM. Reason: Attach simpler spreadsheet

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: How do I SUM cells containing text and numbers within a range.

    Extracting the numeric value from VPJ0020 can be done as follows
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-14-2009
    Location
    Leeds
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: How do I SUM cells containing text and numbers within a range.

    Hi Pepe
    Thank you for your reply.
    I did try to use SUBSTITUTE, but unfortunately I couldn't get it working with my array.
    I need to total values in a 2 dimensional array (date vs time).
    Best wishes
    Mike

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: How do I SUM cells containing text and numbers within a range.

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  5. #5
    Registered User
    Join Date
    03-14-2009
    Location
    Leeds
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: How do I SUM cells containing text and numbers within a range.

    Hi Pepe
    Thank you for your help.

    I have now solved the problem. My formula:
    =IF([Payment type]<>"V",SUMPRODUCT(([Array]=[Client code])/1),SUMPRODUCT(--(LEFT([Array],LEN([Client code]))=[Client code])))

    Best wishes
    Mike
    Last edited by l1velife; 09-23-2013 at 12:59 AM. Reason: Solved

+ 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] Finding median of range of cells containing text and numbers
    By _hs_ in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-18-2013, 12:23 PM
  2. [SOLVED] Change text of one cell based on the numbers of a range of cells?
    By spookymyo in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-18-2013, 04:50 PM
  3. [SOLVED] Ideas for numbers or text in range of cells
    By sctraffic in forum Excel General
    Replies: 4
    Last Post: 07-17-2012, 10:55 AM
  4. [SOLVED] Vlookup formula - return only numbers for cells containing text and numbers
    By Andrew E Smith in forum Excel General
    Replies: 11
    Last Post: 07-03-2012, 06:07 AM
  5. Find, return string address in a range of cells with numbers and text
    By Vera22 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-09-2007, 08:37 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