# Error in Nested IF formula

#### RAMU

##### Active Member
Dear Friends,
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

### Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

#### Michael M

##### Well-known Member
Depending on your version of excel, you may be exceeding the IF limit. On older versions you can't have more than 7 It's in a formula...and you are using 9 IFs

#### sandy666

##### Well-known Member
maybe AF*0.0025 should be AF4*0.0025 ?

#### RAMU

##### Active Member
maybe AF*0.0025 should be AF4*0.0025 ?
Ha Ha Ha, You bang on, what a silly mistake.
Thanks

You are welcome

Replies
3
Views
51
Replies
9
Views
185
Replies
4
Views
67
Replies
4
Views
49
Replies
11
Views
99