IF formula won't work!

fidgen

New Member
Joined
Aug 20, 2002
Messages
46
what is wrong with this? I've switched brackets around and done all sorts, but I'm banging my head now!

=IF((AVERAGE(DataRev!B2:B32))=0,#N/A,IF(Movements!$D2)=0,#N/A,(AVERAGE(DataRev!B2:B32))*Movements!$D2)

I bet its something so **** simple!
:)

cheers
Hugh
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

stickboy

Board Regular
Joined
Jun 23, 2002
Messages
84
To fix
remove the close bracket from (movements!$d2)=0
to say ,if(movements!$d2=0,..........
hope this works for you

stuart
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
On 2002-09-20 03:12, fidgen wrote:
what is wrong with this? I've switched brackets around and done all sorts, but I'm banging my head now!

=IF((AVERAGE(DataRev!B2:B32))=0,#N/A,IF(Movements!$D2)=0,#N/A,(AVERAGE(DataRev!B2:B32))*Movements!$D2)

I bet its something so **** simple!
:)

cheers
Hugh

=IF((AVERAGE(DataRev!B2:B32))=0,#N/A,IF(Movements!$D2)=0,#N/A,(AVERAGE(DataRev!B2:B32))*Movements!$D2)

Why not simply...

=AVERAGE(DataRev!B2:B32)*Movements!$D2

which would give either a non-zero or zero result?

If you rather see #N/A as result when one of the terms is 0, then

=IF(SETV(AVERAGE(DataRev!B2:B32)*Movements!$D2),GETV(),#N/A)

would be an attractive option. SETV and GETV are part of the add-in morefunc.xll, downloadable from:

http://longre.free.fr/english/index.html
 

Forum statistics

Threads
1,143,915
Messages
5,721,512
Members
422,369
Latest member
redinator

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
Top