I copied some names from translate.google.com. Then I pasted it on excel (each name in a column).
Now when I want to split it to keep the first name only, it does not work. It seems like excel can't see the space anymore.
I used this code:
=LEFT(R2;SEARCH(" ";R2;1))
You need to use commas (,) to separate your variables in the formula, so like this:
=LEFT(R2,SEARCH(" ",R2,1))
Does that help?
If not, please also post the contents of cell R2.
Related
I want to sum a column of an Excel tab (depending on the content of another column) which can have different names.
Therefore I dynamically build the name of the tab and then use it in the SUMIF-function.
However, I get #REFERENCE! error and I don't know why?! I can reference single cells this way but not a range which I have to in this case. Can someone see what I'm doing wrong or maybe help me with a workaround?
=SUMIF(INDIRECT(CHAR(39)&Settings!$D$3&"-V"&L$7&CHAR(39)&"!B3:B100";FALSE);B44;INDIRECT(CHAR(39)&Settings!$D$3&"-V"&L$7&CHAR(39)&"!H3:H100";FALSE))
Area to sum as you can see below:-
Cell where I want the sum to be:-
=SUMIF(INDIRECT("'"&YEAR($E$5)&"-V"&L$7&"'!$M$3:$M$10"),"*"&$C9,INDIRECT("'"&YEAR($E$5)&"-V"&L$7&"'!$O$3:$O$10"))
This is the correct use (note I have used the actual character ' instead of CHAR(39))
The wildcard is used to match anything before the cells content as your data contains PL before it and also note the use of absolute referencing.
You will need to change the , to ; to match your regional settings...
I have a list of SSN in my excel file (9 digits, some of which have leading zeros, no hyphen).
I keep them in the special format (numero da seguranca social in portugues) so I can keep leading zeros in the column.
I want to add ' ', to the column so that I can search them in SQL query in bulk.
When I use concatenating formula ( concatenating("'",B2,"'",",")), the leading zeros are gone.
How can I achieve the result of 00XXXXXX as '00XXXXXX', ?
Thank you!
I am not sure what your special format is, but I am guessing that if the value is xx the format makes it look like 00xx. Similar to a zip code.
So the value when you change it to text looks like xx.
I can think of 2 ways to fix it
Write a formulae which basically does what the special format does. For example it would make xx as 00xx. Then you can concatenate this new value like u mentioned earlier
Copy the values from excel to notepad and then paste it to excel again. When you copy from excel to notepad, the formatted value, i.e. 00xx will get copied to notepad which can then be pasted to excel in a separate unformatted cell.
One way of doing this is to copy your SSN column from your file and paste it into a new file all by itself. Then, while ensuring that the SSN numbers are formatted with any appropriate leading zeros, save the new file as a text/tab delimited file and close it. Now, using Excel's Open File command, select your text file and on Step 3 of 3, select Text for the Column data format. Now, you should be able to select that column of data and copy it back to your main file and perform your concatena
Did you try ''00XXXXXX' or "'00XXXXXX"? That is, add one single quote before the number and Excel interprets it as a string, not a number. If you will not do any numeric operations with it, then it should be a string.
Thank you all for your input.
I ended up using #tigeravatar 's method, which is
="'"&TEXT(B2,"000000000")&"'"&","
and it worked for me.
Thank you!
I am working on two sheets of text, Lets say "apples" in sheet1 and i want to find the cells which contains "apples" in sheet2. Below function works for few columns and its not working for few columns even though the text is in both places..
=VLOOKUP("*"&apples&"*",Sheet2!H4:H499,1,FALSE)
I think, its because of the text format in sheet2. I removed unwanted chars using "clean" & "trim" function. but still having issue...
Have anyone faced this issue before...?
Update - This looks more of text format issue. I copied to notepad and found no unreadable chars or new lines...
Instead of
=VLOOKUP("*"&apples&"*",Sheet2!H4:H499,1,FALSE)
please consider using
=VLOOKUP("*apples*",Sheet2!H:H,1,FALSE)
Update - changed to deal with asterisk that I didn't see the first time I tried to answer this.
You need to fix your cells, i.e. change Sheet2!H4:H499 to Sheet2!$H$4:$H$499!
Without doing this, the range you're running the lookup in will move downwards when copying the formula - which is certainly not what you want! :-)
I had some issues with this recently.
I wanted to document that I tried:
look for trailing spaces
numbers formatted as text
ensured arrays were reference locked correctly (e.g. put a $ in front of the part of reference that shouldn't change)
When it still didn't work I copied both values into Notepad++ and changed encoding from UTF-8 to Ansi. What I found was there was a strange hidden character in one of the texts. It was like one of the values had been pasted from word and the space as a "special space" or something. You can get this when a dash is not really a dash but an endash etc.
To fix I pasted my range into Notepad++, changed encoding, search/replace all strange characters with nothing then pasted back into Excel. Then it worked just fine.
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.
In Excel, let's say I have 5 columns, but not all of the time will a column have data.
How can I force it to give a static number of commas?
I end up having some rows like this (as I would like it):
Field1,field2,field3,field4,field5
field1,field2,,,
Then some rows like this:
field1,field2,field3,field4,field5,
field1,field2,
field1,field2,field3,field4,
you mean when exporting? That should happen by default. I tried it just now with Excel 2007 and all exported lines in the .csv-file had the same amount of commas. Those lines with fewer columns had extra commas at the end, just like in your example
Actual exported excel file:
hello;world;;;;
how;are;you;doing;;
hi;;;;;
welcome;to;;;;
the;jungle;;;;
some;line;with;lots;of;columns
The actual amount of commas is determined by the row with the most columns
So in this particular instance, there was a lot of copy pasting going on to create the file.
I finally opened a new worksheet, copied the entire document over, and created a CSV using that.
This resolved my problem.