IIF statement with two criteria

paulfields4

New Member
Joined
Mar 20, 2015
Messages
10
I have all these fields some have negative numbers. If one of the fields does I want it to display a zero. If it does not I want it to display the consultfee assoicated with that invoice. I am trying to do this with the following statement.

=IIf(Nz([1-30 Days]) And Nz([31-60 Days days]) And Nz([61-90 Days days]) And Nz([91-180Days days]) And Nz([180-360Day days]) And Nz([Over360Day days])>=0,0 Or IIf(Nz([1-30 Days]) And Nz([31-60 Days days]) And Nz([61-90 Days days]) And Nz([91-180Days days]) And Nz([180-360Day days]) And Nz([Over360Day days])<=0,([ConsultFee])))
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
What kind of data is in those fields for days? Numbers? True/False? Text?

This formula looks very suspicious!
 
Upvote 0
This formula looks very suspicious!

Note that my main concern was the using of comparison operators and a number (greater than or equal to zero) with potentially text data, which probably would give results that aren't correct. Also IIF may be a less than optimal choice here.
 
Upvote 0

Forum statistics

Threads
1,221,889
Messages
6,162,624
Members
451,778
Latest member
ragananthony7911

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top