Forum Discussion

MattRaw's avatar
MattRaw
Copper Contributor
Dec 13, 2024

Trying to create a box plan with multiple IF functions

Hello all, 

Here's a spreadsheet that I'm trying to create at the moment.

I have taken a formular from another sheet I have access to and it basically works.

However...

On the above I want to combine the formulars on rows 2 & 3 onto the same row (if possible).

The issue I'm having is I want the cells from E2:AG2 to return me a number 3 or 4 depending on the dates in A2, B2, C2 and D2.

Here's the 2 separate formulars that I would like to combine:

Row 2: =IF($A2="","",IF(OR(AND($A2<E$1,$B2>E$1),AND($A2>E$1,$A2<F$1)),3,0))

Row 3: =IF($C2="","",IF(OR(AND($C2<E$1,$D2>E$1),AND($C2>E$1,$C2<F$1)),4,0))

Can anyone help me please?

I hope this makes sense?


Matt

3 Replies

  • peiyezhu's avatar
    peiyezhu
    Bronze Contributor

    https://club.excelhome.net/forum.php?mod=viewthread&tid=1605862&mobile=&_dsign=77571bc7

    gant chart

  • Try this:

     

    =IF(OR($A2="", $C2=""), "", IF(OR(AND($A2<E$1, $B2>E$1), AND($A2>E$1, $A2<F$1)), 3, IF(OR(AND($C2<E$1, $D2>E$1), AND($C2>E$1, $C2<F$1)), 4, 0)))

     

  • In E2:

    =IF(($A2<>"")*($A2<F$1)*($B2>=E$1), 3, IF(($C2<>"")*($C2<F$1)*($D2>=E$1), 4, ""))

    Fill to the right and down.

Resources