+ Reply to Thread
Results 1 to 5 of 5

Scientific Notation(text) and Rounding

  1. #1
    Forum Contributor
    Join Date
    08-14-2013
    Location
    Florida
    MS-Off Ver
    Excel 2013
    Posts
    105

    Scientific Notation(text) and Rounding

    I can't seem to pull in scientific notation that is stored as text into a variable/VBA without it rounding it with ADODB.
    Like
    349812410298421 (shown as 3.49812E+14) keeps rounding to 349812410300000 and I don't understand why.

    For more details see post #5

    Workbook...
    Last edited by Kalithro; 07-12-2016 at 06:09 AM.

  2. #2
    Forum Contributor
    Join Date
    08-14-2013
    Location
    Florida
    MS-Off Ver
    Excel 2013
    Posts
    105

    Re: Scientific Notation(text) and Rounding

    This isn't working either...

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    08-14-2013
    Location
    Florida
    MS-Off Ver
    Excel 2013
    Posts
    105

    Re: Scientific Notation(text) and Rounding

    Well, SQL has made my day a POS. With periods converting to # values. With reading in a workbook as a table just to find out it isn't progressing past 255 fields. To Scientific Notation and unable to convert it to the value it shows me in the formula bar.

    How do I set the SQL string to the data type I want for each column of data?

    Why is there a 255 field limit?

    Am I not setting something up right with my connection string?

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,949

    Re: Scientific Notation(text) and Rounding

    349812410298421 (shown as 3.49812E+14) keeps rounding to 349812410300000
    I am not seeing this scenario. The value in A2 is displayed as 3.49812E+14, but the underlying value is 349812410298421. If I select A2 and look at what is in the formula bar, I see the entire 15 digit number. If I change the formatting from text to number (0 decimal places), all 15 digits are displayed. I am not sure I understand your concern. It appears that all of the information is being imported into Excel, so you should just need to format it in a way that allows you to see all of the information.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Forum Contributor
    Join Date
    08-14-2013
    Location
    Florida
    MS-Off Ver
    Excel 2013
    Posts
    105

    Re: Scientific Notation(text) and Rounding

    Well appearances are deceptive. I can't change the format as I am using ADODB to connect to some spreadsheets (in the example for this post I connect to the same spreadsheet). I can't enter the cell and have Excel recalculate the entered value (as the value was entered then the format set to text). The real resolution at the base of the problem is to tell the team that hands me data to stop entering values then changing format to "Text" but to set the format first then enter data. My results after the value actually being "Text":

    Rounded CDec: 349812410298421
    CStr: 349812410298421
    Just RS Value: 349812410298421
    Format to Text: 349812410298421
    String Variable Conversion: 349812410298421
    CDbl: 349812410298421

    But that required me to enter the cell and press enter (something that I can't do with ADODB/SQL- that I know of). It looks like I am simply stuck with:

    Rounded CDec: 349812410300000
    CStr: 3.498124103e+014
    Just RS Value: 3.498124103e+014
    Format to Text: 349812410300000
    String Variable Conversion: 349812410300000
    CDbl: 349812410300000

    all due to the fact values are entered then the range (where the data in entered) is then set to "Text"- I really just wish Microsoft would fix this as "349812410298421" is the value in the formula bar yet when set to text format it displays as "3.49812E+14" until the user enters the cell and presses enter key, thus resulting in "349812410298421" as text.

    I was looking for something that I could change in my Database connection string or my SQL recordset connection. Like if there is a way to set data type (like I tried in my second post- but this failed as well) before opening the recordset.

+ 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. How to Stop Excel from Displaying Text as Scientific Notation
    By lyndy256 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-17-2015, 01:59 PM
  2. Replies: 8
    Last Post: 08-05-2015, 02:36 PM
  3. Question Regarding Rounding Scientific Notation in Excel2007
    By AngularUnconformity in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-29-2014, 12:50 PM
  4. [SOLVED] Import text file from Excel converts cell value into scientific notation in error
    By maacmaac in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-24-2012, 02:03 PM
  5. Converting Scientific Notation to text strings
    By JohnnyBGood in forum Excel General
    Replies: 1
    Last Post: 05-14-2009, 03:43 PM
  6. [SOLVED] change scientific notation (exponential) back to text
    By GEORGIA in forum Excel General
    Replies: 1
    Last Post: 04-06-2006, 11:30 AM
  7. Using scientific notation in TEXT() function
    By boopathi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-10-2005, 04:05 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