If statement

chally3

Board Regular
Joined
Mar 22, 2006
Messages
157
Good morning all,

I have a complete brain freeze over my problem outlined below and would very much appreciate any help as I will have several spreadsheets I will need to do something very similar with. I am not sure how to write an if statement to look if a cells contains certain text.

In Column E I have a list of numbers that all end in either V01,V02 or V03
In Column G I have a list of country codes for example GB,USA,NL etc etc

What I am trying to do is in Column H is a simple comment of country check ok based on the following criteria.

IF Column E contains V01 in the text and Column G has 'GB' , add the comment 'Country check GB',IF Column E contains V03 in the text and Column G has USA' , add the comment 'Country check USA',otherwise return 'check region'

Thank you kindly as ever

Kind regards
Mark
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
If this is not it please give more detail/examples.

Excel Workbook
EFGH
2123V01GBCountry check GB
3456V02USACheck region
4123V01NLCheck region
598765V03USACountry check USA
IF
 
Upvote 0
IF Column E contains V01 in the text and Column G has 'GB' , add the comment 'Country check GB',IF Column E contains V03 in the text and Column G has USA' , add the comment 'Country check USA',otherwise return 'check region'

=IF( AND( right(E2,3)="V01", G2="GB") , "Country check GB", IF (
AND( right(E2,3)="V03", G2="USA") , "Country check USA", "check region"))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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