I am trying a nested if formula like this

=IF(AND($F4="D",(AE4<=60)),AF4*0.005,IF(AND($F4="D",(AE4<=90)),AF*0.0025,IF(AND($F4="D",(AE4<=120)),AF4*0.0015,IF(AND($F4="D",(AE4>120)),AF4*0,IF(AND($F4="",(AE4<=45)),AF4*0.01,IF(AND($F4="",(AE4<=60)),AF4*0.005,IF(AND($F4="",(AE4<=90)),AF4*0.0025,IF(AND($F4="",(AE4<=120)),AF4*0.0015,IF(AND($F4="",(AE4>120)),AF4*0,0)))))))))

"F" column is carrying word "D" or blank, AE column is signifying Days, & AF column is a value. I am trying to calculate a figure. But when "F" column's cells are "D" & "AE" column (Days) is carrying figure 61 to 90, result is coming #NAME?

Can't figure out my mistake in formula.

Pls help.

Regards

RAMU