If then statement question

lucian688

Board Regular
Joined
Mar 9, 2005
Messages
82
Hi, how do I create a If Then Statement to compare ANY of the values in let's say cell B1-B200 to A1.

See typically the If then Statement to compare a single value would be = if (B1>A1, "STOP", ""), but now we need to test B2 to 1, B3 to A1, B4 to A1.... and have a message stop if ANY of the values in column B is greater than A1

Thank you!
Luke
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
If...Then is a VBA statement not a formula. but your example shows a formula.
So what ado you want a VBA solution or formula?

For formula

=IF(COUNTIF(B1:B1000,A1)>0,"STOP","")
 
Upvote 0
It's a formula we are looking for. Basically in column B we have all these dates & the goal is that if any of the dates is greater than the date in cell A1 we get a warning message.

Thanks!
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,226
Members
452,620
Latest member
dsubash

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