Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
jeremy via OfficeKB.com
 
Posts: n/a
Default Ignoring letters behind numbers

This funtion works for me, if there are no letters behind numbers

=IF(ISNUMBER(B7),(IF(B74000, VLOOKUP(B7,Sheet1!A2:B263,2), "S")), "S")

but some of the numbers have a letter or two behind them, which I want to
ignore (eg. 4123HG i want to recognize as 4123)....

Any Help?

jeremy

--
Message posted via http://www.officekb.com
  #2   Report Post  
bj
 
Posts: n/a
Default

If there are not more than 2 letters following and no preceding letters
Try something like
=IF(ISNUMBER(B7),(IF(B74000, VLOOKUP(B7,Sheet1!A2:B263,2), "S")),
IF(ISNUMBER( value(left(B7,len(b7)-1) ),(IF(value(left(B7,len(b7)-1)4000,
VLOOKUP(value(left(B7,len(b7)-1),Sheet1!A2:B263,2), "S")), IF(ISNUMBER(
value(left(B7,len(b7)-2) ),(IF(value(left(B7,len(b7)-2)4000,
VLOOKUP(value(left(B7,len(b7)-2),Sheet1!A2:B263,2), "S")),"S"))))

(I lost track of the parenthsis. You may need more or less of them at the
end)


"jeremy via OfficeKB.com" wrote:

This funtion works for me, if there are no letters behind numbers

=IF(ISNUMBER(B7),(IF(B74000, VLOOKUP(B7,Sheet1!A2:B263,2), "S")), "S")

but some of the numbers have a letter or two behind them, which I want to
ignore (eg. 4123HG i want to recognize as 4123)....

Any Help?

jeremy

--
Message posted via http://www.officekb.com

  #3   Report Post  
Jason Morin
 
Posts: n/a
Default

Try:

=IF(LEFT(B7,LEN(B7)-(ISERROR(RIGHT(B7)*1)+ISERROR(MID(B7,LEN(B7)-1,1)*1)))*14000,VLOOKUP(LEFT(B7,LEN(B7)-(ISERROR(RIGHT(B7)*1)+ISERROR(MID(B7,LEN(B7)-1,1)*1)))*1,Sheet1!A2:B263,2),"S")

HTH
Jason
Atlanta, GA


"jeremy via OfficeKB.com" wrote:

This funtion works for me, if there are no letters behind numbers

=IF(ISNUMBER(B7),(IF(B74000, VLOOKUP(B7,Sheet1!A2:B263,2), "S")), "S")

but some of the numbers have a letter or two behind them, which I want to
ignore (eg. 4123HG i want to recognize as 4123)....

Any Help?

jeremy

--
Message posted via http://www.officekb.com

  #4   Report Post  
Ron Coderre
 
Posts: n/a
Default

I think this returns what you want:

=LEFT(A1,MAX((--ISNUMBER(--MID(A1,ROW(1:10),1))*ROW(1:10))))

Note: commit that array formula by pressing [Ctrl]+[Shift]+[Enter]

If there will be more that 10 characters, change the 10's to an appropriate
number.

Does that help?

--
Regards,
Ron


"jeremy via OfficeKB.com" wrote:

This funtion works for me, if there are no letters behind numbers

=IF(ISNUMBER(B7),(IF(B74000, VLOOKUP(B7,Sheet1!A2:B263,2), "S")), "S")

but some of the numbers have a letter or two behind them, which I want to
ignore (eg. 4123HG i want to recognize as 4123)....

Any Help?

jeremy

--
Message posted via http://www.officekb.com

  #5   Report Post  
Ron Coderre
 
Posts: n/a
Default

Actually, my first formula only strips text off the back of the cell value.

I believe this formula actually DOES do what you want:

=IF(--(LEFT(A1,MAX((--ISNUMBER(--MID(A1,ROW(1:10),1))*ROW(1:10)))))4000,
VLOOKUP(--(LEFT(A1,MAX((--ISNUMBER(--MID(A1,ROW(1:10),1))*ROW(1:10))))),Sheet1!A2:B263, 2), "S")

Note: Commit that array formula by pressing [Ctrl]+[Shift]+[Enter]

--
Regards,
Ron

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
no row numbers or column letters DISPLAYED RagDyer Excel Discussion (Misc queries) 4 April 24th 23 03:42 AM
How do I sort letters before numbers in Excel? RiverGirl Excel Discussion (Misc queries) 4 May 27th 05 04:09 PM
VLOOKUP for a cell with both letters and numbers Sonohal Excel Discussion (Misc queries) 6 April 8th 05 02:13 PM
Averaging noncontiguous numbers ignoring zeros? Mike Excel Worksheet Functions 19 March 4th 05 02:05 AM
Finding Numbers with Cells that also contain letters Adam Excel Discussion (Misc queries) 7 December 29th 04 02:41 PM


All times are GMT +1. The time now is 03:05 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"