When numbers are stored as text in Excel you see this little guy http://imgur.com/zXdwD
in the upper-left hand corner. when you click on it it gives you the option of converting the text representation of a number to a number upon which math can be done. also, when stored as text numbers appear on the left side of the cell opposed to the right one. I have an array of numbers which are stored as text, but they don't offer that little green thing to convert them to numbers. It may sound trivial but I'm using the Vlookup function to reference a large column of numbers to a code name, but it's not being recognized. And the only thing I can think of is that it's somehow being read differently (the codes are most defintely in the lookup table, and ctrl+f will find them). I want to know if anyone has an idea about what's happening.
Thanks.
The smart tag is a little finicky at times. There's a couple of things you can do.
If you're using code, you can multiply the cells in the range by 1, this will convert them to a number.
Alternatively you can convert the number you're matching to a string and then vlookup. Something similar to:
=VLOOKUP(TEXT(A1,"#"),B1:D10,2,false)
Note TEXT(A1,"#") would round to no decimal places, you may have to adjust the formatting.
The format of some of the cells in the lookup table maybe formatted as text. If there are a lot of them you can create a macro that corrects them. I had the same issue in this SO question although it was the opposite problem.
Another way to correct them would be to copy all the cells in the lookup table in that column and in an adjacent blank column edit>paste special>values>add which makes each of them numeric. Then copy them and paste those back over the originating cells.
A quick trick to convert all numbers formatted as text back to umber format is to copy the data into the "Notepad" application. Then select and copy the data from "Notepad back into your spread sheet and everything will be converted to number format.
Related
I have a subscriber list with emails and phone numbers.
The row with the phone numbers are plain numbers (like 98734543).
With format > custom > "+0;-0;0"
I managed to transform the plain number into +98734543.
Ok - and now I feel stupid. (I wasn't able to google the solution... oh man)
How do I transform the value of the cell (I guess it's a formula now) into an actual value that I can copy into a new row in a way that the cell value isn't just (still) 98734543 but +98734543?
I tried Paste Value (E) but this didn't work either.
Help is very much appreciated, thanks!
In the cell you want the result: =TEXT(A1|"+0")
A1 referencing the source cell. Formatting options to the right of the pipe sign.
Depending on your version of Excel it might be a comma separator instead of pipe.
Since your source is a list without any format, this seems like a better solution: output a list with the wanted format.
I have a column which has positive and negative numbers. I want to find the sum of them. All the values are in Number datatype.
When I use auto sum, I get 0.00 as my result.
Column Image
Also, the values in the column were populated from another columns (like =B2-C2)
However, if I copy and paste the values alone in another column and sum it up, I get the desired result
I agree with BigBen, it sounds like your data is in text format. Even though you change the format on the "Home" tab to "Number", it still might be read by Excel as text.
To quickly change all text "numbers" to real numbers, select the range of numbers and use the "Text to columns" feature under the "Data" tab.
Try making sure that your data is being interpreted as numbers.
For instance, use in E2 "=2*D2". You should get the corresponding number.
Do the same for all your sources cells.
(Given that you mention that these are results from calculations, I expect these to be actually numbers).
If any of the results gives you trouble, you already have the source of your problem.
If all the cells contain numbers, try using in F2 "=SUM(D2:D2)" and expanding the range one cell at a time.
You should be able to identify the source of the problem.
You may help others help you by making your workbook available somewhere online.
You don't need autosum, just SUM (which is anyway the function setup by autosum).
Can Not Get My VLookUp In Excel To Return The Requested Data
I am trying to pull data from another sheet based on data selected from a dropdown on the main sheet.
All the formatting is "General"
=VLOOKUP(F15737,'Location Master'!$A:$J,2,FALSE)
It just keeps returning me #N/A
Try using the Index Match method. It's an alternative to Vlookup which doesn't require data to be sorted and can therefore be of more use.
The typical structure of this method is (the text inside the asterisk will give the ranges specific to your sheet:
=INDEX (**Column from which you want to return a value**, (MATCH(**Lookup Value**, **Column against which you want to lookup**,0))
In this case, if I've understood your workbook structure, the formula should look like this:
=INDEX('Location Master'!$B:$B,(MATCH(F15737,'Location Master'!$A:$A,0)))
This is a common problem with VLOOKUP(). Most likely you have some whitespace (A tab character or some spaces) after one of the values. Click on F15737 and see if there are any spaces at the end of it. Likewise, manually find the value in 'Location Master'!$A and check it for spaces or tabs after the value.
If the whitespace is found in F15737 then you can change your vlookup to be:
=VLOOKUP(TRIM(F15737),'Location Master'!$A:$J,2,FALSE)
If the whitespace is in the range to which you are looking up, then you'll need to trim all of those values, which you can do pretty quickly in a new column with the TRIM() formula.
If this doesn't solve the problem then you might have a number stored as text. Generally excel will tell you if this is the case within the cell with a little green corner indicator. To get Excel to automagically change a column from a "Number stored as Text" to a proper number you can:
Highlight the column
Go to Data>>Text To Columns
Click "Fixed Width"
Click "Finished"
Excel will then format everything automatically (dates to dates, numbers to numbers, text to text, time to time, etc.)
I have individual cells in excel with the following content in each of them
http://www.teng.mossdemo.com.au/wp-content/uploads/images/products/m1423.jpg|http://www.teng.mossdemo.com.au/wp-content/uploads/images/products/m1423.jpg
http://www.teng.mossdemo.com.au/wp-content/uploads/images/products/rt2899.jpg|http://www.teng.mossdemo.com.au/wp-content/uploads/images/products/rt2899.jpg
This is one cell in a long row for a dump of data for products within an ecommerce site. A data migration has somehow added the same image more than once to the same product. Each separate image image is separated by the Pipe "|" symbol.
I want to search each cell in this column of the sheet and remove the duplicated image reference and the Pipe symbol.
So the examples above become
http://www.teng.mossdemo.com.au/wp-content/uploads/images/products/m1423.jpg
and
http://www.teng.mossdemo.com.au/wp-content/uploads/images/products/rt2899.jpg
The suggested answer of finding the pipe with SEARCH is a good general answer, however in this instance as the source string is always twice the length of the desired we can just chop it in half with the formula below and drag it down.
=LEFT(A1,(LEN(A1)-1)/2)
In addition to a formula, you can use Data>Text to Columns, which is a good thing to know about. Select the entire column and then you up the dialog. In step one choose "Delimited" and in step two choose the pipe symbol:
When you're finished, delete the first column.
I figured out that this works for some more complex scenarios. I think it should work for this one as well.
=IFERROR(LEFT(C2,(FIND(LEFT(C2,20),C2,2)-2)),C2)
I entered this into D2 and copied it all the way down the column. I then copied and pasted the values back into Column C.
The problem I had was that not all of the cells in my column had duplicate text. Of those that did, the duplications were not delineated by any unique character (There was a single space in front of each duplication.), and the duplicated text was often an incomplete duplication so the length was not consistently symmetrical.
The "20" is an arbitrary number of characters I picked for excel to use from the front of the text to identify where the text started to repeat. There are enough people here who know excel better than I who can explain what the rest of the formula does. I figured it out by poking around.
I have an Excel spreadsheet with a range of values which are numbers that go to up 20 decimal places, unpivoted from another sheet using the trick from here.
The trouble is the cells are only displaying 10 digits so, for example, even though the value is 5.46827166811115 it is showing as 5.468271668.
I've tried setting the format to text but it still wants to treat it as a number, the number of decimal places varies so I can't use a fixed #.### format. The only way I can get it to show is to format the cells as text and to just select and then click in the entry box for each and every cell!
It then shows a warning that the number in the cell is formatted as text or preceded by an apostrophe but at least it's showing the full value.
I did find a VBA script that just did something stupidly simple like cell.Value = cell.Value for the selection which seemed to work but I can't find it anymore and I can't reproduce that now.
Surely there's an easier way to do this? It wouldn't matter so much but when I import this data through SSIS into a VARCHAR(MAX) it's getting the truncated values!
Pre-pend a single apostrophe ' to the data. In many cases, this is more effective than setting the cell format to text.
You could format the cell as text and the do an .AutoFit so the cell expands to show all the cell content, like this:
Columns("A:A").EntireColumn.AutoFit
that will expand the A:A cell so all its content is visible.
try formatting with #.000 instead of #.###, but if your problem is that Excel is dropping precision on you, you could try multiplying the value by 10^20, then dividing by 10^20 on the SQL side.
found more info:
here
looks like Excel is limited to 15 digits of precision, multiplying by 10^20 doesn't increase the precision, so you can treat it like text or split the remaining digits into another column and combine them back with SSIS or SQL.
Have you added the IMEX=1 to your connection string? That keeps SSIS from trying to figure out the data from the first few rows.
Also, what about using a decimal datatype instead of varchar(max)