How Can I convert Exponential form back to a number? - excel

I am trying to convert exponential form to a number but I can't figure out how it has to be done.
I have a number 1820674000000385406.
I am pasting this number excel after saving this I am following these steps
Format cells->Number and selecting the type.
but after doing this I am not getting my original number I am getting the number as 1820674000000380000
but I want my original number back. Please help me with this.

Excel has a limited resolution of 15 digits for the this type as you can see here:
Excel specifications and limits
Thus Excel saves 182067400000038E+04, which are the 15 first digits of your number and the corresponding exponential.
If you want to keep your number as it is, I recommend you to use a database instead. Excel is not made for these kind of huge numbers.
Best

While storing you can app ' before the number. This would stop excel from converting the number.
Example - 1820674000000385406 would be stored as '1820674000000385406
Another work around is to store number as text. By formatting the cells as to type text.
More details you can find here

Related

Reformatting domestic/international phone numbers with various formats in Excel (VBA or Functions)

PROBLEM:
hey y'all, i have a large dataset of both domestic and international phone numbers formatted in various ways that i need to convert to a particular format based on specific criteria.
example of current phone number formats in the dataset:
###-##-##-####-####
+##-##-####-####
(###) ###-####
+## (#) ## ### ## ##
##-##-######-#
as you can see, the phone number formats vary greatly and there are many more examples that i did not list. i work with datasets averaging 1000+ rows.
what i try varies depending on how much data cleanup i need to perform, but below are some of my current methods.
Approach 1: Manually editing
i have attempted manually updating the phone numbers to my desired formatting. however this is time consuming and leads to user error.
Approach 2: CTRL+1 "Format Cells"
i start by sorting my list of numbers. then follow ctrl+1 > Number > Custom to format the following:
domestic as 000-000-0000, UK as +##-##-####-####, etc.
the issue with this method is that the numbers are stored as formatted "Custom" values. so any special spaces or characters (i.e. "-", "+") do not exist within the string. meaning that i cannot import into my crm.
i have attempted to manually add "'" at the beginning of each formatted phone number, but it removes the special formatting. e.g. ###-###-#### just becomes '##########.
Approach 3: Functions
i have tried using the following functions on domestic phone numbers, but they only work if formatting follows ###-###-####. which is not always the case for the data i work with.
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"(",""),")","")," ",""),"-","")
or
=MID(A1,2,3)&MID(A1,7,3)&RIGHT(A1,4)
Approach 4: Macro
i've attempted recording macros, but this does not work properly since the length/formatting of a cell value and size of a sheet always varies.
Approach 5: VBA script
i am currently exploring various scripts. there are a ton of examples on stackoverflow, but most presume clean data formatted as (###) ###-####. so the scripts do not work for me.
this post was helpful as a first step to removing all special characters from cells: Phone number format
but again, only applies to certain types of formatting.
DESIRED OUTCOME
i undergo this process various times a month and am hoping somebody can help me optimize my approach.
i need domestic numbers to become ###-###-#### and international phone numbers vary, but the UK would look like +##-##-####-####. i need these characters to exist within the actual string of each cell, otherwise my crm will not accept the phone numbers.
I'm not entirely sure, but maybe this gets you going:
Formula in B1:
=MAP(A1:A5,LAMBDA(x,LET(y,CONCAT(TEXTSPLIT(x,TEXTSPLIT(x,ROW(1:10)-1,,1),,1)),TEXT(--y,SWITCH(LEN(y),10,"###-###-####",12,"+##-##-####-####","0")))))
MAP(A1:A5,LAMBDA(x - Loop over a given dataset;
LET(y,CONCAT(TEXTSPLIT(x,TEXTSPLIT(x,ROW(1:10)-1,,1),,1)) - Part where each input gets cleared into just pure numeric characters;
TEXT(--y,SWITCH(LEN(y),10,"###-###-####",12,"+##-##-####-####","0"))))) - Now use SWITCH() to test against the length of the numeric input. If 10 or 12 we kind of know what format we like, the last parameter is the 'standard' format. But obviously you could start adding checks. In the samples given, you'd want to include options for length 11 and 15.

Excel if formula possibility

I have an issue that I don't personally know how to format. I need to subtract numbers that are in seconds, formatted to be viewed as 58.43 or 59.99, but that are sometimes in minutes, formatted as 1:01.33 for example.
I would also need to be able to subtract the numbers from each other to be recognized as (+1.08) or (-0.78), with the parentheses.
I'm sure I can elaborate somewhere, so let me know if this doesn't make any sense. Thanks
It depends if 58.43 is formatted as a number or time. Date and time are stored in number of days, so the time 58.43 is actually stored as the number 0.00067627314814814800000 (58.43/24/60/60).
If both values are time values, then the custom number format of the result can be:
(+s.00);(-s.00);(0.00);#
To handle both cases, instead of =A1-A2 you can try this something like this:
=IF(A1<1,A1,A1/86400)-IF(A2<1,A2,A2/86400)
If those are just time values formatted as mm.ss then you can use TIMEDIFF()
https://support.office.com/en-us/article/Calculate-the-difference-between-two-times-e1c78778-749b-49a3-b13e-737715505ff6
If not, try to convert them to time values and than use TIMEDIFF()
The first part is straightforward
Apply a default format of
ss:00
Then in conditional formatting use a formula
=A2>=TIME(0,1,0)
and apply a format of
m:ss.00
for the ones that are a minute or more.
There is no direct solution to the problem of displaying negative times short of changing the default date system used by Excel as you can see in a number of references. The only way to do it here is to test whether the result is positive or negative and display the positive difference with or without a minus sign.
=IF(B2>=A2,TEXT(B2-A2,"(+s.00)"),TEXT(A2-B2,"(-s.00)"))
The downside of this is that they are actually text values and you can't use them in any further calculations. However the results of A2-B2 are still good even if you can't display them directly, so you can use A2-B2 in subsequent formulae if you want to even if it is negative.

Can you use excel formulas on report data?

So i have some rdfs that download from the server through rwservlet as excels (xls). My question is: can i use excel formulas like sum on the report returned data?
I tried formatting the data (i think here relies the problem as it seem it doesn't affect the data that's already there) and modifying the decimal separator to "." from the rdf. Neither work, not separate or together; the sum formula returns 0. However if i overwrite new data over report data in a field, sum works.
It seems to me it sees all the data returned from the report like text and the formatting doesn't affect the already there data.
Thank you
I go to the root of the problem: the format mask in the rdf was adding a space for sign for the positive numbers. Hence excel was not recognizing it as a number. Problem is after i put a "-" in the format mask to get rid of the space excel re-formats the number automatically from 1.00 to 1 for example. So basically the format mask in the rdf is overwritten, i could not use it at all and i'd get the same result.

Why do Excel values in parentheses become negative values?

A colleague and I encountered a behavior in Excel which isn't clear to us.
Background:
We have a tool which converts an Excel sheet into a table format. The tool calculates the formulas which are in excel and replaces variables inside it with specific values.
The excel tool is used by one of our customers who use values like (8) or (247).
These Value are automatically translated by excel to -8 or -247.
Question:
I saw that many people want to display negative numbers in parentheses. But why would Excel change values in parentheses to a negative number?
I know that I could simply change the cell config to text and this would solve the problem but I wonder if there is a reason for the behavior, since there seems to be no mathematical reason for this.
Its simply the different format of cells you are bringing the "values from" and "pasting to". ..... numbers with parentheses are in cells with "accounting" format and negatives are stored in general or standard number formated cells. To resolve you can change the format of destination cells to accounting using cell formatting as number>accounting.
To answer the why, it's because accountants put negative numbers in brackets for readability
Unfortunately, this is one of the excel feature/bugs that helps some folks and frustrates others. When opening a file or pasting content, excel will immediately and always try to parse any values into formats it deems appropriate, which can mess up data like:
Zip Codes / Tel. # → Numeric: 05401 → 5401
Fractions → Dates: 11/20 → Nov, 20th YYYY
Std. Errors → Negative Numbers: (0.1) → -0.1
For some workarounds , see Stop Excel from automatically converting certain text values to dates
Once the file is open/pasted, the damage is already done. At that point, your best bet is:
Updating the field and displaying as text (appending with ') to prevent re-casting
Formatting the field if the operation wasn't lossy and is just presenting the info differently
Running a clean if/else to pad or other convert your data based on the identified errors
Specific to displaying values back in parens, if excel is converting them and treating them like negative numbers (which may or may not be the appropriate way to actually store the data), you can apply a different format to positive and negative numbers to wrap back in parens.
It is standard practice to write negative values as numbers in parentheses, especially in accounting. This makes negative values stand out much more than a simple negative hyphen; compare -1 and (1).
Excel is a tool very commonly used by accountants and supports accountant-style spreadsheets. Therefore, entering (100) means having a value of -100, even if there is no minus hyphen!
Here is a fun fact, if you enter (-10), Excel will treat it as normal text.

Prevent comma-separated list of numbers being interpreted as single large value

33266500,332665100,332665200,332665300 was the original value, cell should look like this: 33266500,332665100,332665200,332665300 but what I see as the cell value in excel is 3.32665E+34
So the question is I want to convert it into the original string. I have found format function on google and I used it like these
format(3.32665E+34,"standard")
giving it as 332,6650,033,266,510,000,000,000
How to parse it or get back the orginal string? I belive format is the function in vba.
Excel has a 15 digit precision limit. If the numbers are already shown like this when you access the file, there is no way to get the number back - you have already lost some digits. VBA code and formulas will not help you.
If this is not the case, you can add a single quote ' mark before the number to store it as text. This will ensure Excel does not try to treat it as a number and thus lose precision.
If you want the value kept exactly, store the data as a string, not as a number. The data type you are using simply doesn't have the ability to do what you are asking it to do.
If you're starting with an Excel file that has already been created then you've already lost the information: Excel has tried to understand what it was given and its best guess has turned out to be wrong. All you can do (if you can't get the source data) is go back to the creator of the Excel file and tell them what's wrong.
If you're starting with, say, a text file that you're importing, then the news is much better:
If you're importing manually using the Text Import Wizard, then at "Step 3 of 3" you need to set "Column Data Format" for the problem field to "Text".
If you're using a macro, you'll need to specify a value for the TextFileColumnDataTypes property that does the same thing. The easiest way to get it right is to use the Macro Recorder.
If you want the four values in the string to be separate cells, then again, look at the Text Import Wizard settings: in Step 1 of 3 you need to set "Delimited" data type (usually the default) and in Step 2 make sure that "Comma" is checked.
The value needs to be entered into the cell as a string. You need to make whatever it is that inserts the value preceed the value with a '.

Resources