Help With IF or A Macro

Dazzawm

Well-known Member
Joined
Jan 24, 2011
Messages
3,786
Office Version
  1. 365
Platform
  1. Windows
I have in column 'B, cells that have either "With Manual Gearbox" or "With Auto Gearbox" and I want to make these in column 'F' MTM or ATM. I have tried an IF formula which works but only when those words are in the cell. What do I do if there are other words or numbers in the cell is there a macro that will do it? I cant sort alphabetically because like I say there may be other things within the cells and it will stretch down 10000 rows.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
I have in column 'B, cells that have either "With Manual Gearbox" or "With Auto Gearbox" and I want to make these in column 'F' MTM or ATM. I have tried an IF formula which works but only when those words are in the cell. What do I do if there are other words or numbers in the cell is there a macro that will do it? I cant sort alphabetically because like I say there may be other things within the cells and it will stretch down 10000 rows.

try this code.

Code:
=if(len($b2)-len(substitute(Proper($b2),"Manual",""))>0,"MTM",
if(len($b2)-len(substitute(Proper($b2),"Auto",""))>0,"MTM",""))

Regards

Bolo
 
Upvote 0
Hi

Maybe this in F2 -
Code:
=IF(ISERROR(SEARCH("Auto Gearbox",$B2)),IF(ISERROR(SEARCH("Manual Gearbox",$B2)),"","MTM"),"ATM")

and copied down

hth
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,242
Members
452,898
Latest member
Capolavoro009

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