View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default multiple IF statements

Errata....

On Jul 27, 9:01 am, I wrote:
On Jul 27, 7:46 am, Tom wrote:
what would be the best way to write this one? In cell D20:
IF J9<7,D20=J9
IF J9=7,D20=0
IF J97<14,D20=J9-D21


=if(J9<7, 0, (mod(J9,7)<0)*(J9-D21))


Oops, misread the conditions in an attempt to simplify. That should
be:

=if(J9<7, J9, (mod(J9,7)<0)*(J9-D21))

Or perhaps the following would be more clear to you:
=if(or(J9<7, mod(J9,7)=0), 0, J9-D21)


That should be:

=if(J9<7, J9, if(mod(J9,7)=0, 0, J9-D1))