Test a value in a cell

macca99

New Member
Joined
Feb 4, 2009
Messages
6
Hi.

I would like to test a cell value in a range of cells in a specific row and if not found enter text in an adjacent cell.

eg if a cell in the range B2:H2 does bot contain a letter S then in cell A2 show "Does not contain S" Then continue to the next row and do the same test.

TIA
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Is that formula or VBA? Formula wise could be in A1:

=IF(COUNTIF(B2:H2,"*S*"),"Value if contains S","Does Not Contain S")

altho this won't be case sensitive (wasnt sure if this was important)
 
Upvote 0
Thanks Richard.

Case is not important but I trialled your formula and it gave all "Does Not contain S" even though some did have an S.

Macca
 
Upvote 0
Richard you put me on the right track and this is formula worked.

=IF(COUNTIFS(B2:H2,"S")>0,"Has an S", "Does not have an S")

Thanks
 
Upvote 0
Richard's formula should work, but if you mean if it contained an S, it would only contain an S and nothing else, which is indicated by the formula you gave, then you should only need:

=IF(COUNTIF(B2:H2,"S"),"Has an S","Does not have an S")
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,669
Members
448,977
Latest member
moonlight6

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