MOD function with range

hanssorling

New Member
Joined
Jan 22, 2014
Messages
8
Hi

I'm creating a worksheet in Excel from Microsoft Navision. I'm sorting out a number of items from the databas and keeping track of the range were the values will end up in the sheet. Once on the sheet I want to add a cell that checks if the values entered bys the user is possible to devide by three using MOD. I have med the formula =IF(MOD(E5;3)>0;"NOT OK") and that checks one cell. If I for example want to check the cells A1 or A2 or A3 if they can be devided by three I have to enter the formula after each other creating a very long string. There is a limitation in Navision and the will create an error if the string of formula is to long so I want the formula to check the cells I enter for the possiblity to be devided by three in some sim ple way. I can't create a script or anything like tha only a formula that will be entered in a cell. How can I do this?
 
Last edited:

Some videos you may like

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Welcome to the board.

Try
=IF(SUMPRODUCT(--(MOD(A1:A3;3)>0))>0;"NOT OK")
 

hanssorling

New Member
Joined
Jan 22, 2014
Messages
8
Thank you and thank you for the answer.

The problem is that I want to check like this:

If A1 or A2 or A3 is not possible to devide with Three then NOT OK.
 

hanssorling

New Member
Joined
Jan 22, 2014
Messages
8
I did now and it works perfect. Just gonna fix so it show a blank value when it is possible to devide by Three. Many many thanks!!!
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
You're welcome.

To make it blank instead of FALSE, try

=IF(SUMPRODUCT(--(MOD(A1:A3;3)>0))>0;"NOT OK";"")
 

Watch MrExcel Video

Forum statistics

Threads
1,127,354
Messages
5,624,195
Members
416,017
Latest member
moritz210

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