I´ve this simple text inside a cell - this is an example of many with the same issue - and I need to put that into columns, delimited by spaces.
When I do that, the function just do the work with the first sentence, finishing in "deck", and stops there so I´m loosing half of my information or more If I´ve more lines.
I can´t understand why it´s happening, and I worked for hours on a macro that depends on this information as I wrongly assumed this would be plain easy.
($94.52) Hold revenue. Need to set up deck.
($10.89) Hold revenue. Need to contact purchaser.
Thanks for your help!
Ok I got the answer so I´ll post it myself.
I need to separate based on spaces and carriage returns, but I was just trying with spaces thinking there was no way to add carriage returns as a separator. I was wrong.
When you select the function, you´ve a field called "other". There you need to add "Control + J", which is the shortcut for carriage returns.
With that fix, the result is as expected.
Assuming your column is A and starts in row 1, create a second column with the following formula in B1:
=SUBSTITUTE(A1,CHAR(10)," ")
Copy down the entire B column. Copy and paste this column as values.
Now use the Text to Columns functionality, but use space as the delimiter.
Related
I am working with an excel file and I am trying to "map" some values with the vLookUp function.
The first parameter of the vLookUp function is giving me headaches: The function works with certains values (typed by hand in a text format)...but doesnt work with pre-generated values (the sames ones...but generated from an ERP system..). I checked to make sure that I was looking for "same nature" values ( text vs text ) ...but I can't find out why the first 3 values (typed by hand) are fine... but the last 3 (pre generated) gives me a #N/A error: It has to be a difference of "format" ..but I can't find out where's the difference...
This is the formula used: =VLOOKUP(D1;$A$1:$B$219;2;FALSE)
The actual file
1008600 379.99 1008600 379.99
1008601 379.99 1008601 379.99
1010600 449.99 1010600 449.99
1010601 449.99 1010601 #N/A
1013600 489.99 1013600 #N/A
1014601 509.99 1014601 #N/A
1015600 569.99
1018603 679.99
1019600 809.99
Thank you !
Using this formula will address the issue highlighted by RocketDonkey
=VLOOKUP(TEXT(D1,"#"),$A$1:$B$219,2,FALSE)
The issue is that you haven't converted you values in column A to numbers. Since the first three values in your lookup range are themselves strings, they are matching the stringified numbers.
In order to fix, click on one of the numbers in column A, press Ctrl+Space to select the entire column, and then click on the exclamation mark and select Convert to number:
After that, you'll notice that your previous values now show errors, so follow the same process to conver them to numbers as well. #nutsch's solution is does not require you to modify your data, so if the type of your data is not crucial, that is a good fix as well :)
This has been a major pain for me as well(Excel is full of stupid assumptions). What I do is copy the entire column to a text editor, change the column to match the lookup column, and copy and paste the data back into the column. This has worked well for me.
May I highlight the little noticeable reply that Barry Houdini came with in 2012 above:
=VLOOKUP(D1&"",$A$1:$B$219,2,FALSE)
that really works (for me in Excel 2010), despite you are dealing with Numbers or a mix of Numbers or Text strings.
Cudos to Barry, you are a truely Houdini
I have a situation where I have 123 columns of data and out of those 123 colums, only up to 6 of them will be poplated with data. I need to collect all the fields that do have data and put them into one cell.
I found this article, How to merge rows in a column into one cell in excel?, on stackoverflow but it still is not quite what I am looking for and I could not get the =transpose solution to work as suggested at the bottom of the thread. I found a 3rd party solution that was a plugin for Excel but it is only for Windows and I have Office for Mac.
So I desperately need to know how to do this. I'am not showing 123 columns but I think you get the idea.
http://grab.by/BwDu
=concatenate(text,text,text...) is not an option because even if I wanted to put all 123 fields in here i am still faced with the problem of the formula putting in a space or comma in place of a blank field.
The ConcatenateRange function at the link you posted seems to accomplish what you want.
If you prefer a formula, this works for your example data:
=SUBSTITUTE(
TRIM(
B1&" "&C1&" "&D1&" "&E1&" "&F1&" "&G1&" "&H1&" "&I1&" "&J1&" "&
K1&" "&L1&" "&M1&" "&N1&" "&O1&" "&P1&" "&Q1&" "&R1&" "&S1
),
" ",
","
)
Output:
cat,bird,dog,mouse,horse,elephant,chimp,lion,sloth,zebra,geraf,snake,grasshopper
This formula concatenates the data with spaces. TRIM changes multiple spaces to single spaces, and SUBSTITUTE replaces all the spaces with commas.
To reach 123 columns, you'll simply need to continue adding cells.
I need to delete all text to the right of the first "|" in a group of cells.
I had been using this:
=IFERROR(RIGHT(input,LEN(input)-FIND("stack",input)+1),"")
to delete to the left of a specific character. I found this in a stackoverflow question.
I am not sure how to make it so it reads to find the FIRST specific character. I also am trying to delete to the right of, but I believe I can fix that myself.
Thanks in advance
Assuming by the first "|" in a group of cells you mean the leftmost pipe character in each cell of an array of cells then as #Aprillion suggests =LEFT(A1,FIND("|",A1)-1) seems a good approach (where A1 is the first element of the array and the formula is copied across/down as appropriate).
If the group is a column, an alternative could be to use Data > Data Tools – Text to Columns with Delimited and Other: |, then delete inserted columns as required.
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 really tried a LOT with in-built functions and also with google search but none of the ways doesn't worked out for expected result.
My exact problem is:
I've few numeric columns which i got from a website and copied directly into excel.
In those columns there is a SINGLE Leading space at the beginning of each number in the cell of the entire column. Example 523946.00. In this number there is a single space before the digit 5.
I tried a lot with TRIM and SUBSTITUTE in-built functions but nothing able to resolve my problem of removing spaces.
And also my expectation is when i select two or multiple cells in the same column(spaces removed) then automatically Excel should show or display the AVERAGE: <Average value> SUM: <total Sum> COUNT: <count value> at the below status bar or bottom ribbon.
Say, AVERAGE: 175.49 COUNT: 2 SUM: 350.98
This type of information is not showing at the bottom. Only i'm able to see COUNT: 2 alone....why?
I want in General Format only. No any special formats.
I'm using MS Excel 2013
Edit:
You can actually just use find and replace.
Copy one of the trouble cells.
Select all the cells containing non break space, and select find and replace.
Paste the copied cell into the find bar, delete everything but the last character (asuming that is the non breaking space).
Leave the replace bar empty and press replace all.
This removes all non breaking spaces. :)
**Old Solution:**You can add nothing with paste special to the whole column where the spaces occur.
First copy an completely empty cell. (! remember this step)
Then select all cells in the column and right click and select paste special.
Then select "add" almost at the bottom (see picture) and press ok.
This will make excel reevaluate the values as if you had modified in and entered the value manually. Excel then correctly converts them to numbers. :)
First make sure you have the column Formatted as you would like. Make sure it is a number with 2 decimal places (or how ever many you need), then also make sure that there is no Indents (Maybe you think the Indent is a space?) And that you have it Aligned to the Left, Or where you want the Data To be. This alone should take care of your issue.
If that doesn't work here a list of possible solutions.
=Value(Trim(A1)) ' Removes all white space before and after the text in A1
=Value(Clean(A1)) 'Removes all non printable Charactersin A1
=Value(SUBSTITUTE(I3," ","")) 'Substitutes(Replaces) all instances of " "(Space) with ""(nothing)
'****Note: With Substitute you can also specify how many
' Substitutes(Replaces) to make of the value
=Value(SUBSTITUTE(I3," ","",1)) ' Same as above but with only remove the FIRST space
=Value(Trim(Clean(A1))) ' Removes all white space before and after the text
' after removing all Non-Printable Characters
=Value(Trim(Clean(Substitute(A1," ","")))) ' Removes all white space before and after the
'after removing all Non-Printable Characters
' And after replaceing all spaces with nothing
=Value(Right(A1, Len(A1)-1)) ' This takes the End of your text by the number of characters
' in the value Except the First (In your case should be the Space)
=Value(SUBSTITUTE(I6,CHAR(160),"")) 'To help with the non breaking spaces also.
If nothing works could you please share Why you would like to remove the space? As in what you are trying to do with the data? As maybe that will open more solutions
With Ole Henrik Skogstrøm's Suggestion added Value around the functions to get the result as a value.
It may be Excel is treating your cells as text data. Is the fun Green Triangle present?
This is a common problem in excel. Forcing numeric is easier than text. Just format a column as number or General and then put in the function value() into the cells.
Things can be cleaned up from there with Copy/Paste Special values and then remove the original column.
Using Excel 2007
brettdj answered this for me. This is what worked for me and it was SIMPLE!!
To remove the CHAR(160) directly without a workaround formula go to
Find & Replace
in the Find What hold ALT and type 0160 using the numeric keypad
then Leave Replace With as blank and select Replace All
In your case, since you always have a string of numbers, where you want to remove just the first character (a space), this formula should work:
=RIGHT(A1,LEN(A1)-1)
The numbers can vary in length, important is only, that you want to remove just 1, (or 2, or 3 etc) characters. It will still work. {If you had 2 empty spaces in front, then you would use in the formula -2, if three -3, etc)
However, if you had always a different amount of blanks in your string of numbers, like I had, you could use this formula, which worked for me:
=VALUE(SUBSTITUTE(TRIM(A1),CHAR(160),""))
,assuming that the issue you are facing is code "160".
That you can find by typing: =code(A1), which in my case gave me the result "160". Therefore char(160) in the formula above.