ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   subString function in Excel(Urgent) (https://www.excelbanter.com/excel-programming/278348-substring-function-excel-urgent.html)

Varinder

subString function in Excel(Urgent)
 
Hi,
I have some large database files in Excel and I want to
put all the data in a single file. The problem is for
putting all the data in single file is that I have to
break "villageid" into 5 different numbers like suppose
if I have a villageid 1234567891 the first two digit
contains districid , the other two contains cityid, the
other two contains townid etc. I need to break it into 5
different parts so that I can run the SQL query in
Microsoft Excel to compare the data in other files.

Like suppose I have 6 files.
One contain two columns of villageid and name
Other contains 10 columns of districtid and other
facilities.
Other contains 8 columns of cityid and functions.
Other contains 5 columns of townid and seminars.
similarly 2 other files are there.

So, in order to fetch all the data in single file I need
to break it into different number and need to compare it
with columns in other file.





GB[_3_]

subString function in Excel(Urgent)
 
Use the Mid function

For example, =Mid(A1,1,2) returns 2 digits starting at position 1 in the
string - districtid
=Mid(A1,3,2) returns cityid, and so on.

Geoff






"Varinder" wrote in message
...
Hi,
I have some large database files in Excel and I want to
put all the data in a single file. The problem is for
putting all the data in single file is that I have to
break "villageid" into 5 different numbers like suppose
if I have a villageid 1234567891 the first two digit
contains districid , the other two contains cityid, the
other two contains townid etc. I need to break it into 5
different parts so that I can run the SQL query in
Microsoft Excel to compare the data in other files.

Like suppose I have 6 files.
One contain two columns of villageid and name
Other contains 10 columns of districtid and other
facilities.
Other contains 8 columns of cityid and functions.
Other contains 5 columns of townid and seminars.
similarly 2 other files are there.

So, in order to fetch all the data in single file I need
to break it into different number and need to compare it
with columns in other file.







Varinder Dhupar

subString function in Excel(Urgent)
 
Thanks GB.

My Problem has been solved. Thanks very much.




-----Original Message-----
Use the Mid function

For example, =Mid(A1,1,2) returns 2 digits starting at

position 1 in the
string - districtid
=Mid(A1,3,2) returns cityid, and so on.

Geoff






"Varinder" wrote in message
...
Hi,
I have some large database files in Excel and I want

to
put all the data in a single file. The problem is for
putting all the data in single file is that I have to
break "villageid" into 5 different numbers like suppose
if I have a villageid 1234567891 the first two digit
contains districid , the other two contains cityid, the
other two contains townid etc. I need to break it into 5
different parts so that I can run the SQL query in
Microsoft Excel to compare the data in other files.

Like suppose I have 6 files.
One contain two columns of villageid and name
Other contains 10 columns of districtid and other
facilities.
Other contains 8 columns of cityid and functions.
Other contains 5 columns of townid and seminars.
similarly 2 other files are there.

So, in order to fetch all the data in single file I need
to break it into different number and need to compare it
with columns in other file.






.



All times are GMT +1. The time now is 05:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com