PDA

View Full Version : [SOLVED:] Showing two expected values together with an IF function



Mati44
02-05-2018, 02:56 PM
Hello,

I need a little help with this function.
=IF(SUM($BL4:$BM4)>=2,16,IF(SUM($BN4:$BO4)>=2,25,IF(SUM($BP4:$BQ4)>=2,34)))

This IF formula works fine when there is one case that meets the criteria. How do I change it so that when there are two cases meeting the criteria shown together comma separated in the target cell? If there is one true case, it is either 16,25 or 34. When there are two cases, it should be like (16,25) in the target cell. Thanks.

yujin
02-05-2018, 09:03 PM
Give this a try.


=IF(SUM($BL4:$BM4)>=2,16,"") & IF(AND(SUM($BL4:$BM4)>=2,SUM($BN4:$BO4)>=2),",","") & IF(SUM($BN4:$BO4)>=2,25,"") & IF(AND(OR(SUM($BL4:$BM4)>=2,SUM($BN4:$BO4)>=2),SUM($BP4:$BQ4)>=2),",","") & IF(SUM($BP4:$BQ4)>=2,34,"")

Mati44
02-06-2018, 01:45 AM
Thank yujin! This is what I needed.