+ Reply to Thread
Results 1 to 21 of 21

How Can I Add Numbers Separated by a Hyphen?

  1. #1
    Registered User
    Join Date
    08-23-2017
    Location
    Michigan, USA
    MS-Off Ver
    2003
    Posts
    12

    How Can I Add Numbers Separated by a Hyphen?

    I have 12 scores that are entered in separate cells as shown. We calculate the season ending total based on the 7 highest scores. I need to have the 7 highest scores displayed in bold. In addition, the 'running' total needs to be computed based on the 7 highest scores even when there isn't seven scores entered - like early in the season.

    For instance:

    200-14 200-13 200-20 200-20 200-16 200-17 200-18 200-20 200-20 200-12 200-19 200-20

    So the season ending total for this person would be: 1400-137.

    I hope that I was clear enough as to what I am after. I would greatly appreciate any help to get this solved!

    Matt

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: How Can I Add Numbers Separated by a Hyphen?

    Will the first number in your score ALWAYS be 200 ?
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    08-23-2017
    Location
    Michigan, USA
    MS-Off Ver
    2003
    Posts
    12

    Re: How Can I Add Numbers Separated by a Hyphen?

    No they will not be. The first number can vary from 0 to 200 and the second number that is separated by the hyphen can vary from 0 to 20.

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: How Can I Add Numbers Separated by a Hyphen?

    So how do you work out a highest score?

    100-7

    99-8

    Which is the highest score and why?

    What happens if there are more than 7 high scores? Just take the first 7 high scores?

    Do you want Condtional Formatting as well as you say you "need the 7 highest to appear in bold" but make no mention of this elsewhere nor in the thread subject.
    Last edited by Special-K; 08-23-2017 at 11:35 AM.

  5. #5
    Registered User
    Join Date
    08-23-2017
    Location
    Michigan, USA
    MS-Off Ver
    2003
    Posts
    12

    Re: How Can I Add Numbers Separated by a Hyphen?

    The 100-7 would be the higher score compared to the 99-8. Same as 200-15 would be the higher score compared to 199-19.

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: How Can I Add Numbers Separated by a Hyphen?

    You havent said why, it was part of the same question.

  7. #7
    Registered User
    Join Date
    08-23-2017
    Location
    Michigan, USA
    MS-Off Ver
    2003
    Posts
    12

    Re: How Can I Add Numbers Separated by a Hyphen?

    The 100-7 would be the higher score compared to the 99-8. Same as 200-15 would be the higher score compared to 199-19. The first value is the primary number and the second number is the secondary value. The secondary number is typically used to break ties. The total for each person will be based on his/her 7 highest scores. Yes, the 7 highest scores needs to be displayed in bold.

  8. #8
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: How Can I Add Numbers Separated by a Hyphen?

    Here's one idea, not sure I'll have time to complete it.

    The first number ranges from 1 to 3 digits.
    The second number ranges from 1 to 2 digits.

    If you right justify each part of the number you can put the two parts of the number together and rank it completely as a 5 digit number

    e.g.

    =TEXT(LEFT(A1,FIND("-",A1)-1),"000")&TEXT(RIGHT(A1,LEN(A1)-FIND("-",A1)),"00")+0

    You may need a Helper row to do this

  9. #9
    Registered User
    Join Date
    08-23-2017
    Location
    Michigan, USA
    MS-Off Ver
    2003
    Posts
    12

    Re: How Can I Add Numbers Separated by a Hyphen?

    I am sorry but you lost me. Unfortunately, I am not Excel literate darn it anyway. I don't know how to right justify the two numbers in one cell. I don't know what you mean by a 'helper row'.

  10. #10
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: How Can I Add Numbers Separated by a Hyphen?

    If you upload a sample workbook it will be easier to explain if Special-K doesn't have time. What they mean but a "helper row" is that if you have a row of your values (e.g. 222-22, 111-11), you would have a row under them which will show 22222, 11111 (using their formula). This would allow you to sort the values, or find the max values as they will be interpreted as numbers. You can not compare 222-22 and 111-11 directly, but 22222 is clearly larger than 11111

    Edit: one suggestion I would make is to change the formula to
    =NUMBERVALUE(TEXT(LEFT(A1,FIND("-",A1)-1),"000")&TEXT(RIGHT(A1,LEN(A1)-FIND("-",A1)),"00")+0)
    so that the helper row or helper column can be sorted directly
    Last edited by danielexcelvba; 08-23-2017 at 01:12 PM.

  11. #11
    Registered User
    Join Date
    08-23-2017
    Location
    Michigan, USA
    MS-Off Ver
    2003
    Posts
    12

    Re: How Can I Add Numbers Separated by a Hyphen?

    Here is a sample.
    200-20 200-18 199-19 200-14 200-13 200-20 200-11 200-20 200-15 200-13 200-17 200-18 1400-113
    200-17 200-13 200-13 200-17 199-12 200-16 200-15 200-19 200-16 199-13 199-10 200-12 1400-100
    200-13 200-19 200-16 200-13 200-11 200-10 199-11 200-13 200-17 198-12 200-10 199-3 1400-104
    200-16 200-11 200-15 200-16 200-13 200-9 198-5 200-10 200-18 200-10 198-9 200-10 1400-99

    I need the top 7 scores highlighted in bold in each row. Then those 7 scores need to be totaled to the right in the same format XXX-XXX. Unfortunately, I cannot make the totals appear lined up on the right hand side. But this is the jest of it.
    Last edited by pikedrop; 08-23-2017 at 03:33 PM.

  12. #12
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: How Can I Add Numbers Separated by a Hyphen?

    I mean a sample workbook, so that people can make changes to it and show you the results

  13. #13
    Registered User
    Join Date
    08-23-2017
    Location
    Michigan, USA
    MS-Off Ver
    2003
    Posts
    12

    Re: How Can I Add Numbers Separated by a Hyphen?

    How do I go about copying my excel sheet and insert it in a reply?

  14. #14
    Registered User
    Join Date
    08-23-2017
    Location
    Michigan, USA
    MS-Off Ver
    2003
    Posts
    12

    Re: How Can I Add Numbers Separated by a Hyphen?

    I finally figured out how to attach the file. I sure hope someone can help me!
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    08-23-2017
    Location
    Michigan, USA
    MS-Off Ver
    2003
    Posts
    12

    Re: How Can I Add Numbers Separated by a Hyphen?

    This file has the 7 highest scores in Bold. That is the way i would like them to appear.
    Attached Files Attached Files

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,967

    Re: How Can I Add Numbers Separated by a Hyphen?

    There are scores there without hyphens - should they ALL have hyphens?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  17. #17
    Registered User
    Join Date
    08-23-2017
    Location
    Michigan, USA
    MS-Off Ver
    2003
    Posts
    12

    Re: How Can I Add Numbers Separated by a Hyphen?

    Yes, they should all have hyphens.
    Thank you!

  18. #18
    Registered User
    Join Date
    08-23-2017
    Location
    Michigan, USA
    MS-Off Ver
    2003
    Posts
    12

    Re: How Can I Add Numbers Separated by a Hyphen?

    I have added the hyphens that I mistakenly left out.
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    08-23-2017
    Location
    Michigan, USA
    MS-Off Ver
    2003
    Posts
    12

    Re: How Can I Add Numbers Separated by a Hyphen?

    Looks like I have everyone stumped! Oh well, I will find another way.

  20. #20
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How Can I Add Numbers Separated by a Hyphen?

    I think this takes care of the conversions and sums, but I am really stumped on the CF.

    In A7 filled down and across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    For the sums in N7 and filled down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    1
    200-15
    200-15
    200-15
    200-18
    200-16
    200-16
    200-15
    200-15
    200-15
    200-18
    200-16
    200-16
    1400-115
    2
    200-17
    200-18
    199-14
    199-14
    200-16
    200-19
    200-17
    200-18
    199-14
    199-14
    200-16
    200-19
    1400-124
    3
    200-16
    200-11
    198-10
    200-15
    200-12
    199-11
    200-16
    200-11
    198-10
    200-15
    200-12
    199-11
    1400-97
    4
    200-11
    200-9
    198-15
    200-14
    200-11
    198-13
    200-11
    200-9
    198-15
    200-14
    200-11
    198-13
    1400-81
    5
    200-10
    200-8
    200-14
    200-15
    199-13
    200-11
    200-10
    200-8
    200-14
    200-15
    199-13
    200-11
    1400-90
    6
    7
    200015
    200015
    200015
    200018
    200016
    200016
    200015
    200015
    200015
    200018
    200016
    200016
    1400-115
    8
    200017
    200018
    199014
    199014
    200016
    200019
    200017
    200018
    199014
    199014
    200016
    200019
    1400-124
    9
    200016
    200011
    198010
    200015
    200012
    199011
    200016
    200011
    198010
    200015
    200012
    199011
    1400-97
    10
    200011
    200009
    198015
    200014
    200011
    198013
    200011
    200009
    198015
    200014
    200011
    198013
    1400-81
    11
    200010
    200008
    200014
    200015
    199013
    200011
    200010
    200008
    200014
    200015
    199013
    200011
    1400-90
    Dave

  21. #21
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How Can I Add Numbers Separated by a Hyphen?

    Here's the file with the CF figured out. At the bottom A13:L17 is where I worked out the CF formula. It has no function beyond that. If you are satisfied with this those can be deleted. A7:L11 need to stay. Those are helper cells for the CF. Formulas are in post #20.

    The CF formula is
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. Splitting hyphen-separated data into multiple cells
    By kilowhat in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-14-2014, 10:20 PM
  2. [SOLVED] How to extract strings from hyphen separated strings
    By sharathnarayanan in forum Excel General
    Replies: 5
    Last Post: 11-22-2014, 10:01 AM
  3. [SOLVED] Merging two columuns into one, but having it separated by a hyphen
    By brlcarol99 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-08-2014, 12:20 PM
  4. [SOLVED] Custom Formatting of nos. separated by hyphen
    By naira in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-27-2013, 10:56 PM
  5. [SOLVED] Can you take 2 separate time fields and combine the two separated by a Hyphen in a third?
    By airplanesmoke in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-11-2013, 09:59 AM
  6. Replies: 5
    Last Post: 02-22-2011, 06:28 AM
  7. [SOLVED] many numbers in one cell separated by hyphen.
    By baju in forum Excel General
    Replies: 7
    Last Post: 02-09-2005, 11:06 AM

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