new formula after condition met

V

Vincent

First of all, Merry Christmas to everyone

I´ll Try to explain my problem with an example.

I use this simple formula down the column E to solve my problem (TEMPORARILY):

E10 =IF(D10-D$1>=245;"OIL CHANGE";"")

After condition met i have to change that formula manually.
Assuming that D19-D1=249, I will have to insert
in cell E20 =IF(D20-D$19>=245;"OIL CHANGE";"")

So, AFTER each oil change, i need to CHANGE the locked cell. I guess i need
a macro for this one, but then again maybe not :)

Thanks everyone
 
D

Don Guillett

I'm not quite sure if you meant d1 or d9 in your example but something like
this should help. Probably need to change my , to your ;

Sub doformulas()
For i = 10 To 40 Step 10
ms = "if(d" & i & "-d" & i - 1 & ">=245,""oil "","""")"
Cells(i, "e").Formula = "=" & ms & ""
Next i
End Sub
'=IF(D10-D$1>=245;"OIL CHANGE";"")
' IF(D20-D$19>=245;"
 
C

Carim

Salut Vincent,

As long as you type in cell E1 "OIL CHANGE" ...
you can use starting in cell E2 the following formula ...

=IF(AND((D2-(INDIRECT(ADDRESS(SUMPRODUCT(MAX((ROW($E$1:E1))*($E$1:E1=$E
$1))),4,2)))>=245),E1=""),"OIL CHANGE","")

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top