Look for the 6th and 7th character in a cell

Tartesos

Board Regular
Joined
Feb 3, 2011
Messages
109
Hello again.

I was wondering if there is a way, using a formula, to look in a cell and depending on the carachter on the 6th and or 7th place to output a specific information in another cell.

Lets say we have a number, REF345678567.

I need to have a formula that will look that number and when it finds the number 5 (6th carac.) it will fill another cell with information from another columm.

It needs to look also for the 7th carac., in this case 6, and put information on another cell from a columm.

Can anyone help me with this ??

Thanks and regards.
 
After removing the *1, if the value on the 6th and or 7th caract. is a number it give the error #VALUE .... if I put the *1 back and the 6th and or 7th value is a number no problem , but if its a letter , A, B, C, etc .. the #VALUE error comes back ... any solution for this ??

Here is the formula:
=IF(ISNA(VLOOKUP(MID($B4,9,1)*1,configuration!$L$3:$M$21,2,FALSE)),"",VLOOKUP(MID($B4,9,1)*1,configuration!$L$3:$M$21,2,FALSE))

Thanks
 
Last edited:
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Sorry I couldn't get back to you right away.

One qway you might be able to solve your problem is on you lookup (E1:F200) is to enter the number in the E column as text. That way your lookup on your table is alway text whether the letter of the alphabet or number stored as text.
 
Upvote 0
Sorry I couldn't get back to you right away.

One qway you might be able to solve your problem is on you lookup (E1:F200) is to enter the number in the E column as text. That way your lookup on your table is alway text whether the letter of the alphabet or number stored as text.

What is the version of Excel you are on?

What kind of result is the VLOOKUP bit supposed to return - text or number?
 
Upvote 0
The excel is from 2002. And the return is always text. Any solution posible for this??
I have tried that Charlie45 but is not solving the problem.

Thanks
 
Last edited:
Upvote 0
The excel is from 2002. And the return is always text. Any solution posible for this??
I have tried that Charlie45 but is not solving the problem.

Thanks

Try...
Code:
=LOOKUP(REPT("z",255),CHOOSE({1,2,3},"",
    VLOOKUP(MID($B4,9,1)+0,configuration!$L$3:$M$21,2,0),
    VLOOKUP(MID($B4,9,1),configuration!$L$3:$M$21,2,0)))
 
Upvote 0
Yup, that is perfect Aladin ... I only removed the $ in front of the $B4 so I can drag the formula to other cells and it works 100% !! Thank you.

Do you think that I can use this formula also on new versions of Microsoft Office? ... like 2007, 2010 ect ...

Thanks
 
Upvote 0
Aladin, you remember this formula you help me with a few weeks ago?
=IF(ISNA(LOOKUP(9.99999999999999E+307,FIND(data!$B$4:$B$2488,imput!B4),data!$AH$4:$AH$2488))
,"",LOOKUP(9.99999999999999E+307,FIND(data!$B$4:$B$2488,imput!B4),data!$AH$4:$AH$2488))

Sometimes when the formula dont have to give an output data, because is not need it, it gives me a 0 ... a number 0. but the funny thing is that is not happening on others cells that are on the same situation that those with a 0, do you know why ???

Thanks
 
Upvote 0
Aladin, you remember this formula you help me with a few weeks ago?
=IF(ISNA(LOOKUP(9.99999999999999E+307,FIND(data!$B$4:$B$2488,imput!B4),data!$AH$4:$AH$2488))
,"",LOOKUP(9.99999999999999E+307,FIND(data!$B$4:$B$2488,imput!B4),data!$AH$4:$AH$2488))

Sometimes when the formula dont have to give an output data, because is not need it, it gives me a 0 ... a number 0. but the funny thing is that is not happening on others cells that are on the same situation that those with a 0, do you know why ???

Thanks

If FIND fails, this formula would give a blank (i.e., ""). If FIND succeeds and the relevant cell in data!$AH$4:$AH$2488 is empty, you'd get a 0. If you would like a blank instead of 0 in such cases, try the following somewhat modified version:

Rich (BB code):
=IF(ISNUMBER(LOOKUP(9.99999999999999E+307,
      FIND(data!$B$4:$B$2488,imput!B4)),
    T(LOOKUP(9.99999999999999E+307,FIND(data!$B$4:$B$2488,imput!B4),
        data!$AH$4:$AH$2488)),"")

Note that FIND attempts an exact match... Note also that the modification makes the formula a bit more efficient.

Is this what you wanted?
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top