![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 4
|
I need help with a formula that will evaluate whether a number is divisible by 8 (no remainder). If the number in a cell (and it can be any number) is divisible by 8, formula returns Yes, if not, No.
Thanks. |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Quote:
=IF(MOD(A2,8),"not divisible by 8","divisible by 8")
__________________
Regards! Yogi Anand, D.Eng, P.E. Energy Efficient Building Network LLC www.energyefficientbuild.com |
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
Hi,
Use the MOD function. If the test cell is A1, then try: =IF(MOD(A1,8)=0,"Yes","No") HTH, Jay |
|
|
|
|
|
#4 |
|
New Member
Join Date: Apr 2002
Posts: 4
|
That's it. Thanks very much!
|
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
=IF(MOD(A1,8),"No","Yes")
or =MOD(A1,8) and custom format the cell containing this formula as... [=0]"Yes";"No" |
|
|
|
|
|
#6 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Quote:
That's a beauty ... really ingenious use and practical! |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|