Formula - Nested if statement returns FALSE and ignores part of the statement

NathanA

New Member
Joined
Jan 18, 2017
Messages
34
<eomonth($l6,0)+1),$e6,"")))))[ quote]

I am looking at the number of class hours per month across the year, and I have the table set up as such (e.g. 31/01/17, 28/02/17, 30/03/17 in the 3rd row from Q to AB) with the formula in the rows below. The first part of the formula makes the cell blank if a certain condition exists. If the type of record is "Days" I'd like for the number of hours to be multiplied by 5.5, and if it is "Hours" to keep the hours recorded. Adding the last IF statement creates the FALSE error and ignores the last IF statement - without it the formula works. Any guidance would be much appreciated.

Code:
=IF(OR($N4=TRUE,$O4=TRUE),"",IF($F4="Days",IF(AND(Q$3>=$K4-DAY($K4)+1,Q$3<eomonth($l6,0)+1),$e6*5.5,if($f6="hours",if(and(q$3><
EOMONTH($L4,0)+1),$E4*5.5,
IF($F4="Hours",IF(AND(Q$3>=$K4-DAY($K4)+1,Q$3<
EOMONTH($L4,0)+1),$E4,"")))))

I had to separate the formula for it to be accepted. </eomonth($l6,0)+1),$e6*5.5,if($f6="hours",if(and(q$3></eomonth($l6,0)+1),$e6,"")))))[>
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Some sample data with expected results would help others test possible solutions. I think I may have found your problem.

I put your formula into pseudo-code:
Rich (BB code):
If $N4 is True Or $O4 is True Then
    Return ""
Else
    If Q$3 >= ($K4 - DAY($K4) + 1) And Q$3 < (EOMONTH($L4, 0) + 1) Then
        Return $E4 * 5.5
    Else
        IF $F4 = "Hours" Then
            If Q$3 >= ($K4 - DAY($K4) + 1) And Q$3 < (EOMONTH($L4, 0) + 1) Then
                Return $E4
            Else
                Return ""
            Endif
        Else
            What happens if $F4 <> "Hours"?
        Endif
    Endif
Endif
 
Upvote 0
IF F4 does not equal "Days", and does not equal "Hours", I'd like for the value to return $E4. I've already tried using <> in the formula, but it still returns FALSE.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top