Formula problem

Tony Miall

Active Member
Joined
Oct 16, 2007
Messages
304
Morning all,

In a worksheet called MICROMETER I have a range I3:I40 in which each cell of that range has a result of either "OK" or "OVERDUE"

In another worksheet (called FRONT PAGE) I want cell B3 to show the result "OK" only if all of the cells I3:I40 in MICROMETER = OK, if one of the cells in the range does not = OK I want cell B3 in FRONT PAGE to = OVERDUE.

I did this with the following formula :
Code:
=IF(MICROMETER!$I$3:$I$40="OK", "OK", IF(NOT(MICROMETER!I3:$I$40="OK"),"OVERDUE",""))
this seems to work.

However when I apply the same formula
Code:
=IF(VERNIER!$I$3:$I$40="OK", "OK", IF(NOT(VERNIER!I4:$I$40="OK"),"OVERDUE",""))
in cell B4 in FRONT PAGE to look at another worksheet called VERNIER it doesn't work and I can't understand why??

Any help much appreciated as usual.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Maybe i'm missing something, but if you need ALL the values OK in the range, why not the simpler formula?

=if(countif(vernier!$i$3:$i$40,"ok")=38, "ok", "overdue")

HTH

M.
 
Upvote 0
I'm doing this in 2010 for a friend and he's using 2003. For some reason the first formula I posted and the one Valco posted worked for me and not him. Apologies, I should have been clearer in the beginning
 
Upvote 0
Strange...

The formula Valko posted in #4 seems perfect to me - in 2003, 2007, or whatever version...

M.
 
Upvote 0
Strange...

The formula Valko posted in #4 seems perfect to me - in 2003, 2007, or whatever version...

M.
It seems pretty good to me, too! ;)

Here's my understanding of what was wanted...

The range of cells will contain ONLY "OK" or "Overdue". No empty cells.

If EVERY cell in the range contains OK, return OK otherwise return Overdue.

So, my thinking is that it would be easier to test the range to see if it contains ANY count of Overdue rather than to test to see if EVERY cell contains OK.

Consider this example:

Book1
A
1OK
2OK
3OK
4Overdue
5OK
6OK
7OK
8OK
9OK
10OK
Sheet1

There are 10 cells in the range.

You could do this...

=IF(COUNTIF(A1:A10,"ok")=ROWS(A1:A10),"OK","Overdue")

Or, you could do this...

=IF(COUNTIF(A1:A10,"overdue"),"Overdue","OK")

I chose the latter.

You could also do this array formula...

=IF(AND(A1:A10="ok"),"OK","Overdue")

...but I didn't want to "over complicate" a simple task.
 
Upvote 0
Valko,

Your reasoning is perfect! I suggested the alternative formula
=if(countif(vernier!$i$3:$i$40,"ok")=38, "ok", "overdue")

to prevent that a "smart guy" tries copy + paste a different value in the range breaking the validation-rule.

Just in case....

M.
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,787
Members
452,942
Latest member
VijayNewtoExcel

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