Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 516
Default Convert text to number automatically

I am trying to compare drawing revisions from 2 different sources but am
having difficulty due to the sources having either text or number formats.
Sheet 3 (PH1) is the 1st source and is from another excel spreadsheet - no
problem. All formats are GENERAL.
A B
1 Drwg Rev
2 0001 0
3 0002 0
4 0003 A
5 0004 A
Sheet 2 (PH2) is the 2nd source and is an export from an external document
management program that I would like to import weekly. I want to use this
sheet exclusively for pasting export data only (ie do not do anything else
with it here). All formats are TEXT.
A B
1 Drwg Rev
2 0001 0
3 0002 1
4 0003 B
5 0004 0
Sheet 1 (COMPARISON) is where I would like to compare the documents with the
desired results as shown in column D where Y=YES;
A B C D
1 Drwg PH1 PH2 Change
2 0001 0 0
3 0002 0 1 Y
4 0003 A B Y
5 0004 A 0 Y
Formulas entered into sheet 1 are as follows (row 2 shown only).
A2=IF(ISTEXT(PH2!A2),PH2!A2,"")
B2=IF(ISERROR(VLOOKUP(A2,PH1!$A$2:$B$5,2,0)),"",VL OOKUP(A2,PH1!$A$2:$B$5,2,0))
C2=VLOOKUP(A2,PH2!$A$2:$B$5,2,0)
Note that PH2 is the most current sheet and contains all drawings whereas
PH1 does not (hence different formulas above). All revisions in column C
would be either be equal to or greater than column B. Note that revisions
are alphabetical then numerical ie A,B,C then 0,1,2.
Given the text/number format compatability issue, and the comparison between
letters and numbers, I am sure that a VB code would do what I'm looking for
(but I would feel more comfortable with a formula if possible).

Any ideas? Thanks in advance.

--
Regards
Matt
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 834
Default Convert text to number automatically

Try

B2:
=IF(ISERROR(VLOOKUP(--A2,PH1!$A$2:$B$5,2,0)),"",VLOOKUP(--A2,PH1!$A$2:$B$5,2,0))
C2:
=IF(ISNUMBER(--VLOOKUP(A2,PH2!$A$2:$B$5,2,0)),--VLOOKUP(A2,PH2!$A$2:$B$5,2,0),VLOOKUP(A2,PH2!$A$2: $B$5,2,0))

--

HTH

Bob

"Matt" wrote in message
...
I am trying to compare drawing revisions from 2 different sources but am
having difficulty due to the sources having either text or number formats.
Sheet 3 (PH1) is the 1st source and is from another excel spreadsheet - no
problem. All formats are GENERAL.
A B
1 Drwg Rev
2 0001 0
3 0002 0
4 0003 A
5 0004 A
Sheet 2 (PH2) is the 2nd source and is an export from an external document
management program that I would like to import weekly. I want to use this
sheet exclusively for pasting export data only (ie do not do anything else
with it here). All formats are TEXT.
A B
1 Drwg Rev
2 0001 0
3 0002 1
4 0003 B
5 0004 0
Sheet 1 (COMPARISON) is where I would like to compare the documents with
the
desired results as shown in column D where Y=YES;
A B C D
1 Drwg PH1 PH2 Change
2 0001 0 0
3 0002 0 1 Y
4 0003 A B Y
5 0004 A 0 Y
Formulas entered into sheet 1 are as follows (row 2 shown only).
A2=IF(ISTEXT(PH2!A2),PH2!A2,"")
B2=IF(ISERROR(VLOOKUP(A2,PH1!$A$2:$B$5,2,0)),"",VL OOKUP(A2,PH1!$A$2:$B$5,2,0))
C2=VLOOKUP(A2,PH2!$A$2:$B$5,2,0)
Note that PH2 is the most current sheet and contains all drawings whereas
PH1 does not (hence different formulas above). All revisions in column C
would be either be equal to or greater than column B. Note that revisions
are alphabetical then numerical ie A,B,C then 0,1,2.
Given the text/number format compatability issue, and the comparison
between
letters and numbers, I am sure that a VB code would do what I'm looking
for
(but I would feel more comfortable with a formula if possible).

Any ideas? Thanks in advance.

--
Regards
Matt



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 516
Default Convert text to number automatically

Thanks Bob. That converts the text to number format. Any thoughts on what
formula I would use in Column C to achieve the desired results (refer my
original post) noting that the revision hierarchy is A,B,0,1 (ie A = lowest
and 1 = highest). The data I submitted is only a small sample. Formula
would need to allow for hierarchy as A,B,C,D,.....,Z,0,1,2,3,4,etc.
--
Regards
Matt


"Bob Phillips" wrote:

Try

B2:
=IF(ISERROR(VLOOKUP(--A2,PH1!$A$2:$B$5,2,0)),"",VLOOKUP(--A2,PH1!$A$2:$B$5,2,0))
C2:
=IF(ISNUMBER(--VLOOKUP(A2,PH2!$A$2:$B$5,2,0)),--VLOOKUP(A2,PH2!$A$2:$B$5,2,0),VLOOKUP(A2,PH2!$A$2: $B$5,2,0))

--

HTH

Bob

"Matt" wrote in message
...
I am trying to compare drawing revisions from 2 different sources but am
having difficulty due to the sources having either text or number formats.
Sheet 3 (PH1) is the 1st source and is from another excel spreadsheet - no
problem. All formats are GENERAL.
A B
1 Drwg Rev
2 0001 0
3 0002 0
4 0003 A
5 0004 A
Sheet 2 (PH2) is the 2nd source and is an export from an external document
management program that I would like to import weekly. I want to use this
sheet exclusively for pasting export data only (ie do not do anything else
with it here). All formats are TEXT.
A B
1 Drwg Rev
2 0001 0
3 0002 1
4 0003 B
5 0004 0
Sheet 1 (COMPARISON) is where I would like to compare the documents with
the
desired results as shown in column D where Y=YES;
A B C D
1 Drwg PH1 PH2 Change
2 0001 0 0
3 0002 0 1 Y
4 0003 A B Y
5 0004 A 0 Y
Formulas entered into sheet 1 are as follows (row 2 shown only).
A2=IF(ISTEXT(PH2!A2),PH2!A2,"")
B2=IF(ISERROR(VLOOKUP(A2,PH1!$A$2:$B$5,2,0)),"",VL OOKUP(A2,PH1!$A$2:$B$5,2,0))
C2=VLOOKUP(A2,PH2!$A$2:$B$5,2,0)
Note that PH2 is the most current sheet and contains all drawings whereas
PH1 does not (hence different formulas above). All revisions in column C
would be either be equal to or greater than column B. Note that revisions
are alphabetical then numerical ie A,B,C then 0,1,2.
Given the text/number format compatability issue, and the comparison
between
letters and numbers, I am sure that a VB code would do what I'm looking
for
(but I would feel more comfortable with a formula if possible).

Any ideas? Thanks in advance.

--
Regards
Matt



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically convert Text with 2-digit year juniper810 Excel Discussion (Misc queries) 3 April 24th 23 03:46 AM
how to convert a number to words automatically in a sheet? Mohit Gujjar Excel Worksheet Functions 1 March 5th 07 11:58 AM
Turn off Automatically convert number to date KY Excel Discussion (Misc queries) 2 February 1st 07 08:04 AM
can i convert numbers to text automatically paddington Excel Worksheet Functions 2 March 6th 06 10:27 AM
how to automatically convert a number to words in Excel Anil-HML Excel Worksheet Functions 6 November 9th 05 03:04 AM


All times are GMT +1. The time now is 06:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"