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

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
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
 

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
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
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
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
 

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569

ADVERTISEMENT

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
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832

ADVERTISEMENT

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))
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
you're WELCOME :)

the last clarification did the trick, you could have put this in your inital question
 

Forum statistics

Threads
1,136,510
Messages
5,676,281
Members
419,617
Latest member
Shane50GT

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