How to convert text to number in Excel? - excel

All examples I see they convert text to number but the content is a number in text format. I need to create numbers for emails so I can use that as a unique id.
What I need is to go from: test#example.com to a unique number.

More detail on pnuts solution.
Column A has your e-mails.
Column B has =row()
C1 has =if(iserror(vlookup(A1,$A$1:B1,2,0)),B1,vlookup(A1,$A$1:B1,2,0))
Drag the formula down.
Column C will contain the row number if the address hasn't been listed above, and the row of the first instance if it has been listed. If your emails don't start in row 1 (such as if you have headers or something), then you'll have to edit all the 1's the the first row of your table with e-mails and place the first formula in that row of column c.
So maybe C3 would have =if(iserror(vlookup(A3,$A$3:B3,2,0)),B1,vlookup(A3,$A$3:B3,2,0))

Write below line in any of the cell in Excel
=VALUE("2.0")
This will return the conversion of text(string) to number. Select Function from MenuBar (I think its in Insert tab) for other functions.

Related

dynamically select an excel element

guys,
I want to select an element from a column based on column name. This column changes its place time to time and that's why I want to achieve this dynamically. I couldn't post an image here so I'll try my best to explain it in words.
In the excel sheet I'm trying to select an element located at B2 dynamically based on column name of B2. For sake of simplicity lets say the column name of B is column2. Since my column2 would not always be on B place I want to select that dynamically.I also want this to achieve without VBA code if possible.
Really look forward for your help. Thanks!
Below formula may help you in this,
Explanation:
MATCH will return the column position of "DOB", if DOB is in column C, MATCH will be returning 3.
ADDRESS will the row 1 address of column C, $C$1 hence; which is a text in fact.
Pass this text to INDIRECT function so that it gets converted to range. Now INDIRECT function will be pointing to cell C1.
Use cell C1 as reference and return 3 item in that colum.
=OFFSET(INDIRECT(ADDRESS(1,MATCH("DOB",1:1,0))),3,0)
Formula is expecting row 1:1 as header. You can pass B2 in place of "DOB".

How to arrange small size of excel rows (subset) according to large size of other excel rows?

I have excel sheet with 500 rows and more than 10 columns. The first column is subject id.
And I have list of subject id approximately contains 2000 id. The 500 id in the spreadsheet is subset of the external 2000 id.
I want to arrange the spreadsheet rows according to the external list of ids.
Edit:
I have spreadsheet 'A' of 500 rows
and spreadsheet 'B' with 5000 rows
I want to edit spreadsheet 'A' by place its rows at the same position (row number) of its occurrence in 'B'.
In other words, you can see from above pictures that:
First subject of 'A' '2196978' is located in row number 2 in 'B'. My task is to put '2196978' of 'A' in row number 2
Second subject of 'A' '2219364' is located in row number 9 in 'B'. My task is to put '2219364' of 'A' in row number 9
and this is done by insert rows in 'A' if the subject of 'B' is not exist in 'A'.
This result is what I want:
Without resorting to Macros I don't think what you want to achieve is possible, however it is possible to get something very close. The core issue is that a function cannot create rows so you have to start with the number you want to end up with.
I my proposal you end up with a 3 Book solution. Book A with 500 rows, Book B with 2,000 rows, and Book C which is the result also with 2,000 rows but many of them blank.
You would start by creating Book C with a complete list of IDs from Book B i.e. all 2,000 of them. This could be a copy and paste or you could assign them using the Excel = function. For this example put them into column "A".
Next we want data to appear only if it is in Book A. We do the lookup using VLOOKUP() and if the data is missing we get a #N/A error.
So before things get complex in column B of the new Book add the formula:
=IF(ISNA(VLOOKUP(A1,[BookA]Sheet1!$A$1:$A$200,1,FALSE)),"row missing","row there")
This will return a text message indicating if the row exists in Book A and will be used as a flag to display the remainder of the data.
Check this works and if it does change it to:
=IF(ISNA(VLOOKUP(A1,[BookA]Sheet1!$A$1:$A$200,1,FALSE)),FALSE,TRUE)
We now want to get column B, C, D etc. from Book A based upon the True/False flag we have created. So column C in the new sheet is something like:
=IF($B1,[BookA]Sheet1!B1,"")
If you have the $ signs in the right places is should copy and paste nicely.
You have 2 options for improving this and getting nearer your objective.
Embed the initial lookup in the 2nd IF statement
Use conditional formatting to turn the text white if it should not be there (including the ID)
I have not done either of these because it is un-readable and is basically write once code that you can never modify without starting again.
Good luck.
You have to use the below formula in spreadsheet B which contains 5000 rows,
=IFERROR(INDEX(SheetA!$A:$J,MATCH($A2,SheetA!$A:$A,0),COLUMN()),"")
This is a simple INDEX - MATCH formula which looks up values in SheetA matches it with SheetB and prints output in SheetB. Use the formula in SheetB cell B2.
Explanation:
A2 cell in SheetB is matched with A:A in SheetA.
If found, pulls all the column data of that item from A:J from SheetA.
Once you pasted the formula in B2, drag it across all required columns. Then drag the same across all rows or just double click the fill handle, so that the formula is filled for all 5000 rows and data is pulled.
Let me know if you face any difficulties. Hope this helps.

Sequence number in excel for non blank rows

How to add sequence numbers in excel, wherein the sequence number starts based on the value of the column B. It should not add the sequence if there is no text in the corresponding row of Column B.
So the row 4 should start with 1 since the column B is having some value.
The example sheet is attached.
Also how can i auto update the sequence if i add new row to it.
In A2, enter the following formula and copy down as required.
=IF(B2="","",MAX($A$1:A1)+1)
In A2
=COUNTA(B$2:B2)
and fill down

Exporting excel to csv when field on multiple rows

I have been given an excel spreadsheet to convert to csv. The problem is that one of the fields is a description field in which in sentence in the description is on a separate row. So for example the first product is on row 1. The first line of the description is on row 1, the second line of the desription is on row 2, with all the other columns in that row empty. Most products have about 6 rows of description. The next product then starts on, say row 7.
I have tried exporting the data but naturally excel creates one line in a csv file per excel line so most of the rows are empty rows with just one sentence of description (e.g. , , , "sentence 2", , )
Please can you advise if there is a way to handle this?
Thanks
One way to deal with this is to get all of the description lines into a single cell in the same row as the rest of the fields, and then get rid of the mostly-blank rows that just have the extended descriptions.
Lets assume your spreadsheet has product information in columns A and B, and the description fields in column C, like this:
In D1, enter the formula
=C1
In D2, enter the formula
=IF(A2<>"",C2,D1&"/"&C2)
Fill this down the rest of column D, producing this:
For each item, column D now contains the full description on the last row for that item. Now we're going to get that value back up into the row with the rest of the data fields for the item. In E1, enter the formula
=IF(A1<>"",OFFSET(D1,MATCH(TRUE,LEN(A2:A20)<>0,0)-1,0),"")
Hit Control-Enter to enter it as an array formula, and then fill down the rest of column E, producing this:
You need to enter one extra value after the last row (the "End" in the image above) to make this work. Now you have the full description for each item in column E. Copy column E, paste values, sort by column E to group together all the blank rows, and get rid of all the rows that don't have values in column E. You can get rid of columns C and D at this point if you want to, which leaves you with this, which you can now export to CSV:
There's a small spreadsheet that illustrates this at http://www.filedropper.com/multiline
I'd suggest to export one line per product with whole description in one place. Let's say you have a product name in column A and product descriptions in column B. You can put all descriptions in one cell with this formula (this formula assumes that you start it with cell C1):
=IF(ISBLANK(A2);B1&C2;B1)
Drag this formula till the last row, copy-paste as values (copy column C and paste it as values) and then delete "empty" (by column A) rows. Here you have one row per product with description in one place.

A formula to Find/Replace mobile telephone numbers in text format

I have a column where I input mobile telephone numbers. Here's sample input for Column A (text format):
+639154112315
+639171214125
+639179120519
I have a column (B) where I input mobile numbers (text format) that are for removal e.g.:
+639171214125
So Column C should display:
+639154112315
+639179120519
In Cell C I want to display the mobile numbers from Cell A but not any numbers from Cell B. I tried VLOOKUP and it doesn't work (for Cell C):
=IF(ISNA(VLOOKUP(B2,A:A,1,FALSE)),"",A2)
Is this possible in Excel?
Taking a guess that by Cell you mean Column, the following (copied down as appropriate) might suit;
=IF(IFERROR(MATCH(A1,B:B,0)=0,A1),A1,"")
Edit If you had merely wished to identify in ColumnA those not present in ColumnB Conditional Formatting might suit, with a formula such as =ISNA(MATCH(A1,B:B,0)>0).
You may want to post a data sample. Does column B have the actual numbers? Or a flag to remove the number of the same row?
Consider:
To build a contiguous list of numbers to be removed, add a helper column with the formula
=IF(ISBLANK(B2),"",ROW())
in cell C2 and copy down. Then enter this formula into cell D2:
=IFERROR(INDEX(A:A,SMALL(C:C,ROW(A1))),"")
Copy down. The result is:
In this setup, it does not really matter what the values in column B are. It can be a "yes" or a "delete" or the actual phone number. The important bit is that the cells in column B are either empty or have a value (any value).

Resources