Forum Discussion
Re: Welcome to the Excel Community
You cannot use multiple criteria arguments in IF. If you require multiple criteria to be satisfied, use AND to combine them. For example:
=IF(BJ67>0,IF(BJ68>0,IF(BJ67<BJ68,BJ69,IF(BK67>0,IF(BK68>0,IF(BK67>BK68,BK69,IF(AND(BL67>0,BL68<0),BL69,IF(AND(BM67<0,BM68>0),BM69,IF(AND(BN67<0,BN68<0,BN68<0),BN69,0)))))))))
But it's hard to understand the logic behind the formula, so I have no idea whether this does what you want.
- Rob_CowlynJul 01, 2024Copper Contributor
Thank you VERY much! That was exactly what I needed. Your knowledge amazes me....
One last question. I have literally hundreds of formulas I have created, but they all have conditions where IF a cell is either greater than zero or less than zero. I have included a typical one below. What I failed to consider was what happened if the targeted cell actually WAS zero. How I can insert that condition (i.e. if targeted cell is NOT zero, then move on with the formula. I am hoping I can include this at the very start of the formulas, when I can hopefully do a find and replace with ALL the cells I just built. Perhaps it is an IF NOT situation, or perhaps I can do this with <> or ><. If I have to open a new parentheses ( with the additional argument, I need to know where to close it in the formula with a ). Your further help would be greatly appreciated! Thanks, Robin
=IF(AND(G73<0,G74>0),G73,0) - HansVogelaarJul 01, 2024MVP
What would you have the formula =IF(AND(G73<0,G74>0),G73,0) return if G73=0? And if G74=0?
- Rob_CowlynJul 01, 2024Copper ContributorI'm sorry but I don't understand. Can you show it with all commas and parentheses in place, please? The ? marks confuse me and this doesn't show me where to put the parentheses. My final zero in my EXAMPLE was the return if false (and I still need my false return, as it isn't always a zero but is often a cell reference). I just need to include, at the right place, (at the beginning if possible), an argument that supercedes my <0 or >0 throughout the whole formula if the reference cells are actually zeroes (not positive or negative numbers) then continue with rest of everything I wrote. So my formulas only come into play where the cells they are referring to are anything OTHER than an actual zero. Thank you!