Adding an OR condition to the MOD formula

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
How do I update the following formula to add, or if "0", then the result is also "5"
=MOD(L7+2,5)
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hi,

it would be good to study how to nest functions

check helpfiles for OR
OR(logic1, logic2, ....)

kind regards,
Erik

EDIT: deleted part of message which could be confusing
 
Upvote 0
Ive already tried a couple solutions, neither worked
=OR(L7=0,5,MOD(L7+2,5))
=if(L7=1,5,MOD(L7+2,5))
Anybody, have a working solution
 
Upvote 0
in fact when rereading your question, it can be interpreted in different ways
can you tell us in plain english what you are trying to do ?
and provide some examples
 
Upvote 0
L7 can only be 1,2,3,4 or 5, so in L8 i want 2 increase the result in L7 by 2,
so the rule is if
L7=1, then L8=3
L7=2, then L8=4
L7=3, then L8=5
L7=4, then L8=1
L7=5, then L8=2
 
Upvote 0
suddendly I understand what you were trying to do

your second formula was close :)
just replace "1" by "3"
=IF(L7=3,5,MOD(L7+2,5))
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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