+ Reply to Thread
Results 1 to 11 of 11

Possible to Sum a hyphenated range?

  1. #1
    Registered User
    Join Date
    07-31-2017
    Location
    San Diego, CA
    MS-Off Ver
    2007
    Posts
    4

    Possible to Sum a hyphenated range?

    Can I sum a hyphenated range? For example:

    Column A - Quantity
    10 - 15

    Column B - Rate
    $1.00

    Column C - Total (i.e. contains formula A * B = C)
    $10 - $15

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,942

    Re: Possible to Sum a hyphenated range?

    Not in any way that is useful other than for display purposes - you would not be able to use the result in a SUM formula, for example.

    A simple way to do what you want: use columns A, B, and C with
    10
    '-
    15

    and in D use $1
    then in E F and G use

    A*D
    '-
    C*D
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    07-31-2017
    Location
    San Diego, CA
    MS-Off Ver
    2007
    Posts
    4

    Re: Possible to Sum a hyphenated range?

    Thanks for the reply. That idea did occur to me, but was hoping there was another way.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: Possible to Sum a hyphenated range?

    You could use something like this:

    =B1*LEFT(A1,SEARCH("-",A1)-1)&" - "&B1*MID(A1,SEARCH("-",A1)+1,255)

    But the result, like the entry in A1 will be TEXT, not a number.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Registered User
    Join Date
    07-31-2017
    Location
    San Diego, CA
    MS-Off Ver
    2007
    Posts
    4

    Re: Possible to Sum a hyphenated range?

    That's very clever! Do you know if there's a way to tweak to the formula so that the final number always has two numerals after the decimal (i.e. 1.50 vs. 1.5) and dollar symbols in it? I.e. column C displays as $20.00 - $30.00

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,942

    Re: Possible to Sum a hyphenated range?

    Use the TEXT function, and make sure that you use TRIM and VALUE as well

    =TEXT(B1*VALUE(TRIM(LEFT(A1,SEARCH("-",A1)-1))),"$0.00")&" - "&TEXT(B1*VALUE(TRIM(MID(A1,SEARCH("-",A1)+1,LEN(A1)))),"$0.00")

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Possible to Sum a hyphenated range?

    Maybe you want...

    =TEXT(B1*LEFT(A1,SEARCH("-",A1)-1),"$0.00")&" - "&TEXT(B1*MID(A1,SEARCH("-",A1)+1,255),"$0.00")
    HTH
    Regards, Jeff

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: Possible to Sum a hyphenated range?

    Yep.

    Use this:

    ="$ "&TEXT(B1*LEFT(A1,SEARCH("-",A1)-1),"0.00")&" - "&"$ "&TEXT(B1*MID(A1,SEARCH("-",A1)+1,255),"0.00")
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-31-2017
    Location
    San Diego, CA
    MS-Off Ver
    2007
    Posts
    4

    Re: Possible to Sum a hyphenated range?

    Thank you!

  10. #10
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Possible to Sum a hyphenated range?

    You are very welcome. We are happy to help.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: Possible to Sum a hyphenated range?

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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] Replace hyphenated prefix of concatenated columns removing to much
    By capson in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-14-2015, 05:02 PM
  2. Number list to a hyphenated range
    By sprinter in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-19-2012, 12:03 PM
  3. [SOLVED] Formatting with a Hyphenated name
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-12-2012, 04:57 PM
  4. Parsing hyphenated number ranges in a field
    By pete171 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-23-2008, 07:24 AM
  5. [SOLVED] How do I separate a hyphenated word in Excel?
    By [email protected] in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-26-2006, 08:25 AM
  6. Replies: 4
    Last Post: 11-17-2005, 10:20 AM
  7. Sorting hyphenated numbers
    By Connie Martin in forum Excel General
    Replies: 5
    Last Post: 01-20-2005, 08:06 PM

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