+ Reply to Thread
Results 1 to 3 of 3

Formula returning distance based on text - search for several types of decimal separators

  1. #1
    Registered User
    Join Date
    08-15-2014
    Location
    Denmark
    MS-Off Ver
    365 Pro
    Posts
    94

    Formula returning distance based on text - search for several types of decimal separators

    Hi

    For the attached spreadsheet example, I'm trying to make N11 return the total distance in F16-F1015. The table in C16:G1015 is based on imported reference data, and sometimes, the loaded data is being separated by both "." and "," and sometimes there are no separators.

    My issue is, that the formula doesn't recognize F16 and F17, because they either don't have a decimal separator, or a comma as decimal separator:

    {=IF(ISNUMBER(SEARCH(OR(".",","),$F$16:$F$1015)),(SUM(IF(ISNUMBER(FIND(OR(".",","),$F$16:$F$1015)),VALUE(LEFT($F$16:$F$1015,FIND(OR(".",","),$F$16:$F$1015)-1)),0)))/1000,(SUM(VALUE($F$16:$F$1015)/10000000)))}

    In the attached example, the return value of N11 is 92.33 meters (which is incorrect), but if I change F16 to "4125.0000" and F17 to "5925.0000", it returns the correct value.

    The formula is supposed to just return the SUM of the values on the left side of any eventual separators.
    Last edited by chriskay; 05-27-2019 at 08:38 AM.

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Formula returning distance based on text - search for several types of decimal separat

    perhaps the below alternative would work for you ?

    =SUMPRODUCT(LEFT(0&F16:F1015;FIND(",";SUBSTITUTE(0&F16:F1015;".";",")&",")-1)/10000000)
    assumed ; delimiter per locale

  3. #3
    Registered User
    Join Date
    08-15-2014
    Location
    Denmark
    MS-Off Ver
    365 Pro
    Posts
    94

    Re: Formula returning distance based on text - search for several types of decimal separat

    Quote Originally Posted by XLent View Post
    =SUMPRODUCT(LEFT(0&F16:F1015;FIND(",";SUBSTITUTE(0&F16:F1015;".";",")&",")-1)/10000000)

    Changing the last dividing to 1000 seems to return the correct value, no matter what values I enter in Distance, so I think this is the formula I need :-)

+ 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. Replies: 2
    Last Post: 12-09-2016, 07:18 AM
  2. Formula not returning a Value based on the search
    By JesseSingh in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-24-2016, 05:54 AM
  3. [SOLVED] Excel Quirky issue???? with french decimal separators
    By Code Flunkie in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-20-2015, 09:03 AM
  4. [SOLVED] Formula not returning desired number of digits after decimal, add text
    By Russ Fuquay in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-25-2013, 01:39 PM
  5. Macro to convert decimal separators from US to EU format when loading a CSV file?
    By Knut Grossmann in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-18-2013, 04:01 PM
  6. Problem with decimal and thousand separators
    By inqmobile in forum Excel General
    Replies: 7
    Last Post: 08-27-2012, 12:10 PM
  7. Replies: 11
    Last Post: 05-31-2010, 06:25 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