MATLAB: Converting numeric values to NaN - excel

I'm trying to import an excel file containing latitude and longitude data into MATLAB. I'm using the 'Import Data' option. It is reading the latitude and longitude information just fine except that some of the longitude cells are being marked as unimportable and being replaced by NaN. They contain values like -119.253 etc. What could be the reason for this? I just want to keep the original information.
Below is a snapshot of a portion of my Excel spreadsheet:

The screenshot shows the Problem. All numbers that are left-alligned aren't real numbers, that is text. Numbers are alligned to the right.
Mark the column in excel and change the format to number.

Related

Is there a way to calculate the average of all these times (Excel 2019)?

I'm trying to find the average time of all these times (see link), but there doesn't seem to be a format that won't convert these into 12 hour time. I currently have them stored as text, so the average currently cannot be calculated. I've tried multiple h:mm:ss formats and related formats, but they all don't give an average after =AVERAGE (C2:C20). Is there a way to do this? Thanks
With the values stored as text, you can get the average with
=AVERAGE(VALUE(C2:C21))
(this will have to be entered as an array formula if you're using Excel 2019 or earlier)
(the entries in column D are all numbers, with the custom-number format h:mm:ss.0 applied to them)

Why am I obtaining this strange value multiplying 2 number having different format using Excel?

I am very new to Excel and I have a problem with a simple multiplication (I know, it is depressing but I'm stuck).
I have to multiply the numeric content of 2 cells (these value are calculated using 2 different formulas).
The problem is that it seems that these 2 cells contain numeric values having different format and I obtain a strange result.
Infact I have:
1) The K3 cell containing this value: 0,0783272400
2) The K6 cell containing this value: 728.454911165
In another cell I simply do:
=K3*K6
but now I am obtaining this nonsense value: 57.057.862.655,9996000000
I think that the problem could be related to the fact that the first one use the , do divide integer section and decimal section, and in the other one I am using . to divider the integer section and decimal section.
How can I correctly handle this situation?
Format both values as Currency in Excel and forget about the issue.
You are getting it, because the floating point values are not represented differently in many programming languages. In Excel probably the best way to make sure you do not give strange values is to format as Currency.
Or in VBA to use the CDec and to convert to decimal.
Is floating point math broken?
Excel is treating 0,0783272400 as something less than one tenth and 728.454911165 as getting on for one thousand billion. The result is formatted with . for thousands separator and , for decimal separator - and is not nonsensical (though the choice of formatting is).

Excel saved decimal datas as date time

After I export my data to Excel my some of my decimal values converted to date format by Excel. For example, my decimal data was 1.25 but it seems Jan.25 in Excel. How can I re-convert to correct decimal format ?
When you import the data set the column data type specifically to number.
Without sample data (both input and resulting Excel values) it is hard to diagnose the problem.

How to format Microsoft Excel data labels without trailing decimal on round values?

(Not sure if this is the best stack for this question).
What is the format to have 14500 read as $14.5K but to have 3000 read as just $3K without the trailing decimal point?
I can't seem to comprehend the correct expression from the manual.
Excel does not appear to support this functionality using custom format codes. However, there is a way to simulate this. Create a new column that uses the function ="$"&A1/1000&"K".
Original ="$"&A1/1000&"K"
$3,500 $3.5K
$3,000 $3K
$14,500 $14.5K
$13,300 $13.3K
$25,000 $25K
$250,000 $250K
To get this to work, I formatted the cell's of the data column 4
4
4
4
3.5
13.5, by either selecting the column and then right click and format cells or by right clicking on the chart and selecting format data labels.
I formatted this with the regular expression $#K so that the data then shows as
$4K
$4K
$4K
$4K
$4K
$14K. The consequence is that the number is rounded to not include the decimal.
Now, all i needed to do was separately format the individual cell's that had decimal values by right clicking on the individual cell's and changing their format to #.0K.
Thus we now have, $4K
$4K
$4K
$4K
$3.5K
$13.5K
Also, the , can be used in the regex ($#,K for round numbers, $#.0,K for decimal) for data of thousands, like my original question.
This was an acceptable solution for me because there were only two such fractional data points.
For a larger dataset, you will need to use a conditional expression to determine all the cell's that have decimal values.
One way to do this, is like so:
If your numbers are in column B, apply this formula for column C
=B1=INT(B1)
This will show TRUE if the data is of INT data type (no decimal precision) and FALSE if not.
Now, select column C and select Data\Filter\Autofilter
From the drop-down list in C1, select FALSE
This will show only the decimal numbers and hide the whole numbers.
And now you can apply the relevent formatting as described above.

how to prevent excel 2010 from converting times to decimals automatically when cell is pasted

As you might have come accross, MS Excel tends to convert times to decimal values. I do want it to convert the values automatically because I need the time value. Suppose I have following data:
Departure | Time
Istanbul 06:45
Ankara 01:30
I am using Concatenate function to create a desired string as Istanbul: 08:00 and Ankara: 18:30. However, when I use the formula, Excel converts hours to decimals and I get Istanbul: 0.28125 and Ankara: 0.0625. I do not want it to convert. How can I do this?
ps: This also happens when I copy time values from Excel to Notepad++. Moreover, when I import time values into PostgreSQL through add-in, I still get decimal values in the columns
You want to use the TEXT function to convert the time into the text format that you require. Something like this:
=CONCATENATE("Istanbul: ", TEXT(A1,"hh:mm"), " and Ankara: "18:30, TEXT(A2,"hh:mm"))

Resources