Input and output in Excel

dharvey

New Member
Joined
Jul 12, 2019
Messages
10
Hi all,

i am have a small issue with my excel function. my goal is if i enter a file name it outputs the drive letter is should be on. the problem is that all of the file names are numbers and i only want it to search the first three characters but it does not. my function is:

=LEFT(IF(ISNUMBER(SEARCH("96",C27)),"O",IF(ISNUMBER(SEARCH("98",C27)),"Q",IF(ISNUMBER(SEARCH("99",C27)),"K",IF(ISNUMBER(SEARCH("90",C27)),"T",IF(ISNUMBER(SEARCH("91",C27)),"T",IF(ISNUMBER(SEARCH("71",C27)),"T",IF(ISNUMBER(SEARCH("68",C27)),"T","I"))))))),3)

what come out with is as follows:

inputoutputnotes
296.41516.asmO:\
524.00240.parI:\
525.02800.parI:\
524.00141.parI:\
496.42928.asmO:\
496.42928-1.parO:\
496.42928-2.parO:\
525.01260.parI:\
523.01340.parI:\
523.06370.parI:\
596.44990.parO:\
540.25471.parT:\this should be i:\
496.42935.asmO:\
496.42935-1.parO:\
496.42935-2.parO:\
523.10590.parT:\this should be i:\
525.02790.parT:\this should be i:\
598.96123.parO:\this should be q:\

<tbody>
</tbody>

for some reason it is going past the first three character and reading something it should not (in red).

thanks
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
You are looking at the entire text, not just the first 3 numbers.
One option is to change your formula like
=IF(ISNUMBER(SEARCH("96",LEFT(C27,3))),"O",
 
Last edited:
Upvote 0
Slightly shorter
=IF(OR(ISNUMBER(SEARCH({"68","71","91","90"},LEFT(C27,3)))),"T",IF(ISNUMBER(SEARCH("96",LEFT(C27,3))),"O",IF(ISNUMBER(SEARCH("98",LEFT(C27,3))),"Q",IF(ISNUMBER(SEARCH("99",LEFT(C27,3))),"K","I"))))
 
Upvote 0
thanks so much, that did the trick. i did not realize that you would have to do that with in each search function.
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,216,773
Messages
6,132,637
Members
449,740
Latest member
tinkdrummer

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