Using IF function to insert information

lily231

New Member
Joined
Aug 15, 2017
Messages
5
I think its easier to just show you!

CompanySector
LMArchitectArchitect
PJKArchitectsArchitect
PLPlumberPlumber

<tbody>
</tbody>

I have a list of companies in column one. I want to include the sector in column two. However they are a mix of letters and types. Is it possible to use the IF function or something similar to say for example "IF architect present in A1 THEN write Architect in A2"

It will have to be able to detect architect when it is inside a word, and not standing on its own.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
redarchitectbluearchitect
bluearkitectred
this formula is used
=IF(ISERROR(SEARCH("architect",A1)),"","architect")

<colgroup><col><col span="9"></colgroup><tbody>
</tbody>
 
Upvote 0
Hi, if you have a list of all possible sectors then you can try like this, for example:


Excel 2013/2016
ABCD
1CompanySectorList of Sectors
2LMArchitectArchitectArchitect
3PJKArchitectsArchitectPlumber
4PLPlumberPlumberCarpenter
5Baker
Sheet1
Cell Formulas
RangeFormula
B2=LOOKUP(1,-SEARCH($D$2:$D$5,A2),$D$2:$D$5)
 
Upvote 0
can you explain how your formula works please - especially the minus sign....

Hi, from the help for LOOKUP()..

If the LOOKUP function can't find the lookup_value, the function matches the largest value in lookup_vector that is less than or equal to lookup_value.

Because we can't necessarily know what number the SEARCH() function is going to return to the lookup_vector we turn those results negative. Then by using 1 as the lookup_value we can ensure that we get a match if appropiate.

You can get the same result by using a big lookup value instead, i.e.

=LOOKUP(9.99E+307,SEARCH($D$2:$D$5,A2),$D$2:$D$5)
 
Upvote 0

Forum statistics

Threads
1,216,009
Messages
6,128,258
Members
449,435
Latest member
Jahmia0616

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