PDA

View Full Version : Solved: Formula help again



austenr
08-24-2010, 10:40 AM
I need to change this formula from this:

=IF(D9<="07-01-1996","Colgate",IF(D9<=--"07/01/2000","Hills",""))
to make the second if:

If D9, >07-01-1996 and <= 07/01/2000, etc.

grichey
08-24-2010, 10:43 AM
Sub Macro1()
'
' Macro1 Macro
'

'
ActiveCell.FormulaR1C1 = _
"=IF(R[-2]C[-1]<=""07-01-1996"",""Colgate"",IF(R[-2]C[-1]<=--""07/01/2000"",""Hills"",""""))"
Range("E12").Select
End Sub

austenr
08-24-2010, 10:46 AM
looks like the same thing. can you explain?

grichey
08-24-2010, 10:49 AM
I misread your initial post. Apologies.

So you want anything earlier than 7/1/96 to be colgate. anything b/w that and 2000 to be hills and anything after that to be blank?

grichey
08-24-2010, 10:55 AM
If that's the case, you can use this formula

=IF(D9<=DATE(1996,7,1),"Colgate",IF(AND(D9>DATE(1996,7,1),D9<=DATE(2000,7,1)),"Hills",""))

austenr
08-24-2010, 10:57 AM
so i want anything that is before 7/1/1996 = Colgate
between 7/2/1996 up to and = to 7/1/2000 = Hills and
everything else be blank.

grichey
08-24-2010, 10:58 AM
i had 2 back to back posts. let me know if the 2nd doesn't solve.

austenr
08-24-2010, 11:00 AM
thats it (the second one). thanks