SOLVED

Struggling with formula with different conditions

Copper Contributor

Hi all, new member here, been banging my head on the desk with this as I can't see why it isn't working.

 

Situation; If column J is equal to C, and column T is equal to value between 1 and 3, then take the earliest date in columns K:M and minus 1 month... I have this working as; =IF(AND(T6>=1, T6<=3, J6 = "C"),MIN(K6:M6)-30)

 

I am then trying to add in the caveat (on the same formula) for; if column J is not equal to C, and column T is equal to value between 1 and 3, then take the earliest date in columns L:M and minus 1 month, I have tried =IF(AND(T11>=1,T11<=3,J11="C"),MIN(K11:M11)-30),IFNOT(AND(T11>=1,T11<=3,J11="C"),MIN(L11:M11)-30) and various other adaptations but no joy and it just returns a blank cell.

 

Can anyone see what th

 

 

5 Replies
best response confirmed by Triki578 (Copper Contributor)
Solution

@Triki578 

 

How about this?

=IF(AND(T6>=1,T6<=3,J6="C"),MIN(K6:M6)-30,IF(AND(T6>=1,T6<=3,J6<>"C"),MIN(L6:M6)-30,""))

 

You may also consider using EDATE function like EDATE(MIN(K6:M6),-1) to replace MIN(K6:M6)-30.

 

Many thanks@Subodh_Tiwari_sktneer worked like a charm, from the variations I tried, I appeared to be missing the "" from the closest ones.

 

Thank you for the prompt about EDATE, I was thinking this too :)

 

@Triki578 As a variant.

=IF(AND(T11>=1,T11<=3),IF(J11="C",EDATE(MIN(K11:M11),-1),EDATE(MIN(L11:M11),-1)),"")

 

Hi@Riny_van_Eekelen , many thanks for your response, much appreciated

1 best response

Accepted Solutions
best response confirmed by Triki578 (Copper Contributor)
Solution

@Triki578 

 

How about this?

=IF(AND(T6>=1,T6<=3,J6="C"),MIN(K6:M6)-30,IF(AND(T6>=1,T6<=3,J6<>"C"),MIN(L6:M6)-30,""))

 

You may also consider using EDATE function like EDATE(MIN(K6:M6),-1) to replace MIN(K6:M6)-30.

 

View solution in original post