Hi Gale,
You could put the following formula into H2 and copy it down as many rows as
you need to. Note that this formula must be entered as one continuous line.
=IF(AND($F2>=10,$G2>=$D2),"Compliant",IF(AND($F2>=10,$G2<=$D2),"Noncompliant",IF(AND($F2<10,$E3>=$D3),"Compliant",IF(AND($F2<10,$E3<$D3),"Noncompliant,""))))
Note that this formula would be a lot easier for users to understand if you
used local defined names for your columns, that were column-absolute,
row-relative. That way the formula would read something like this:
=If(AND(YrsService>=10,TestDate>=NotBeforeDate)...
where YrsService might be the defined name for column F, TestDate for column
G, and NotBeforeDate for column D. The row would then be relative to the cell
containing the formula.
You enter the defined name as follows:
For YrsService:
Select any cell in column F, then
Insert>Name>Define...
in the "Names In Workbook:" box type
'Sheet1'!YrsService
click in the "Refers To:" box and press F2, then
remove the $ sign in front of the row number.
Click the "Add" button.
Repeat for each additional name, being sure to select a cell in the
respective column.
---
If you prefer to use VBA, you can edit CheckMyCells() sub as follows:
Replace: 'do some OK thing
with: Cells(Row, "H").Value = "Compliant"
Replace: 'do some NOT OK thing
with: Cells(Row, "H").Value = "Noncompliant"