Excel preserving original dataset format - excel

Does anyone know how can I open or import data from a dataset and preserves it's original column structure and formatting. For example, there are leading 0 in front of the numbers, and each column is exact width.

Import it using Power Query (Get & Transform Data). It is located in the Data tab in the ribbon. This is the easiest and more user friendly method. Just make sure that the columns are formatted as Text and not Number, this will preserve your leading zeros.

Related

How to format cells from a csv or xlsx file in excel with an ISO_4217 currency that can be reused for calculation

Issue description
I am exporting a table containing strings, numeric values, percentages and currencies to a csv or xlsx file for example:
CH0038863350,nominatives Nestlé SA,1,CHF 848.48,SHARE,6.72%
US0378331005,Stammaktien Apple Inc. 2,USD 118.64,SHARE,-55.13%
The issue that I have with the import in excel is, that it recognizes and formats some values as Currency and other values are just in the General format.
I would like to format the values in such a way, that I can reuse them for further calculation.
The currency values are in the ISO_4217 format.
After some reasearch I have found out, that this is not so easy to do, because excel uses currency symbols ($,£,€, etc.) internally.
Questions
Do I have to convert my data to a specific format in order to work? Can I setup a custom format for my cell values that will support the desired format and then can still be used as a number for further calculation?
A simple workaround would be to export the numbers and the currency into two columns.
What would you suggest?
EDIT: The point was, that I wanted the format to be in one cell not in two (split of currency and value). The latter is fairly simple.
Click on the "Data Ribbon" and select "From Text/CSV". Choose your file and select "comma" as delimiter.
Next choose "transform data", highlight the column with the currency values, and choose "split column by delimiter".
Click "Close and load".
Finally, if you don't want your table to stay connected to the csv-file, right-click on the query which was created and choose "delete"
There might be simpler ways to do this as well, but I think this should work for you.

Cannot Plot in Excel Following CSV Data Import (all values = 0)

I have recently upgraded from Office 2010 to 365. I imported a CSV data file into excel to create a plot from the data. The data appears correctly, but when I insert a chart to plot the imported data, all values appear to be zero. It seems that in some instances the data is displayed in the cell, but cannot be plotted.
My initial reaction was that the format of the imported data may have spaces or other characters forcing the cells to contain text rather than numbers, but this isn't the case (see below for a sample). Changing the cell format after import does nothing.
I can perform operations on the problem data using a formula within excel (e.g. '=A1 + B1') and everything works. If you add two of the problem cells together, you get the correct result in the correct format and the new cell contains a value that can be plotted.
If I import the same delimited data file into Excel 2010, then everything works fine, including plots.
What has changed between the two versions that could cause this unusual behaviour?
See below in the screenshot, I have plotted a series of decimal values in Excel (O360) after transposing the original data, and the plot shows all zeroes on the y axis despite the cells containing data. It does not see them as values for plotting, but it does see them as values within formulae - which is very odd.
Note: In the plot below I manually typed the left most column which forms the x axis
This is the format of my imported data row. I see nothing wrong with it:
0.312551;0.137288;0.137288;0.283603;0.200974;0.223328;0.200974;0.223328;0.194638;0.240637;0.194637;0.240637;0.0930865;0.0930865;0.047336;0.047336;0.0646357;0.0646357;

Excel pivot converts text to zero when numbers in column

I am attempting to pivot some data using Excel; however, the text (non-numeric) values are being converted to zero (0). The format of the cells of the entire worksheet are in Text; I have tried other formats including all cells as General, and a variety of combinations involving both formats. The actual values (including both text and numeric) are visible when selecting the little down arrow that appears to the right of Value when the mouse-pointer hovers over it in the Fields Section to the right of the main field.
What must I do to get the text values to appear?
If there is no more than one value for each Group/Column pair, and if you have Excel 2010 or later, you can use Get & Transform or Power Query to Pivot the Name column and chose the Do Not Aggregatge option.
If you have multiple entries for each Group/Column pair, you will need a different solution.

Exported dates not sorting correctly

I'm using an application called Kroll OnTrack to manage a review of documents as part of a litigation project. Kroll can export the metadata for these files into an XLS file. The problem is that when Kroll exports the dates for these documents, it seems to do so as a string, and the dates are being exported in MM/DD/YYYY format, so when I go to sort by date, the documents line up in this order:
01/01/2005
02/02/2005
03/05/2010
04/07/2006
05/03/2007
...and so on.
I need to be able to sort the table by date so we can put together a chronology of these documents. Trying to force Excel to re-format as a date doesn't seem to work, nor have I had any luck using DATEVALUE(). Right now, I'm doing text-to-columns then re-concatenating the dates, which seems to work, but is there a more elegant/efficient solution for this issue?
Perform Text-to-Columns on that column of dates but with some optional commands.
On the first screen of the T2C wizard, choose Fixed Width and click Next.
On the second page of the wizard, discard any border that Excel added by dragging them up out of the Data Preview window. It is very likely that none will be there. Click Next.
On the third page of the wizard, choose Column data format, Date and MDY from the drop-down selector beside Date.
Click Finish.
You should be left with real dates in the column. This procedure is easily recorded for future use.
In a column adjacent to your text dates, you could try something like this
DATE(RIGHT(E3,4),LEFT(E3,2),MID(E3,4,2))
Then copy down and sort/filter on this column of real dates.
Where cell E3 contains you text-date. You could also follow up with Text(...,"yyyy-mm-dd") or some other date format, if you need the date in a specific format.
The formula assumes that the text string contained in cell E3 is of length 10 (i.e. all white space is trimmed and padded zeros for day and month are used). If this is not the case, the forumula is easily amended.

How to specify all columns as "Text" in Text to Columns function in Data tab?

I have data in a column that needs to be split into multiple columns using Text to Columns in the Data tab. However, there will be a variable amount of columns created for each row, variable from 1 - 1000. In the Text to Columns wizard Step 3, it defaults to 'General' format for all columns. My data involves very big numbers, and I do not want them trailed (rounded), so I need to set the format as Text.
This is a problem to do manually because I would have to go through every column and click Text, and the wizard doesn't even show all the columns unless you scroll. Ideas?
Although it is not exactly what you want (and I see you don't like the idea of scrolling), when you are presented the data preview showing each column as General.
You can select the first column header and holding the Shift key scroll to the right and select ALL of the columns at once.
Then select Text as the data format.
Not the best, but better than selecting each individually.
Click the first column as you would do normally to change its format to text, but then scroll to the last column. Hold down Shift and click the last column.
This should select all the columns. Now, change the format and finish :)
I have a related problem and I have discovered a work around solution.
I have a .TXT from MYOB (accounting package). It has some document header information in the first six rows then the table header and the data. On the Import Wizard it is only showing me two columns (which matches the document header information in the equivalent of A1 and B1) so I can't set the third column to "TEXT" instead of "GENERAL". It is treating the MYOB account codes as dates which is causing no end of headaches.
I've done the same plenty of times with these MYOB .TXT files before and Excel has picked up the table header row without problems but for some reason it is now having trouble on this file. Even more strangly it has successfully done it on one of the .TXT files I am trying to use. I can't see what I am doing differently.
WORKAROUND SOLUTION (BTW: "Using Excel 2010")
I want the header information but I first set up the import stating at row 7, set the import type for each column and run. Then I go back to 'Data' -> 'Connections' -> 'Properties' -> 'Definition' Tab -> 'Edit Query' then reset to start at row 1 and click finish and it worked. Beats me why.

Resources