+ Reply to Thread
Results 1 to 5 of 5

Formula to look for multiples of a number in a range

  1. #1
    Registered User
    Join Date
    01-07-2013
    Location
    Boston
    MS-Off Ver
    Excel 2011
    Posts
    2

    Formula to look for multiples of a number in a range

    If I have a range of numbers, say A1 is 3, B1 is 6, C1 is 9...multiples of 3. Is it possible to figure out if there were any multiples of 4 that fell into those categories?
    For Example, A1, answer would be no, as the range of 1-3 doesn't have any multiples of 4, yet B2 should be yes, as it includes 4, 5, 6. So should C1, as it contains an 7,8,9.
    What formula can I use in Excel to figure that out?
    I am thinking of something simple, where you can just point to "above" or to the range of numbers from A1...X1, and the row below (A2, B2...) would tell me if the above number contained a multiple of 4 or not.
    Thank you for the help.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Formula to look for multiples of a number in a range

    hi Beantown, welcome to the forum. you can try:
    =MOD(A1,4)<>A1

    MOD will give the remainder of the number after dividing by the divisor "4". since 3 cannot be divided by 4, it returns 3 again. and i put a statement behind that solution is not equals to A1. so "3" is not equals to 3 is FALSE. whereas B1 & C1 will get a MOD result of 2 (remainder after dividing by 4) & 1 respectively, & thus not equals to B1 & C1. so when it's TRUE, you can say that it has multiples of 4.

    you can further expand if you want the text "yes" or "no"
    =IF(MOD(A1,4)<>A1,"yes","no")
    Last edited by benishiryo; 01-07-2013 at 10:58 PM.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    01-07-2013
    Location
    Boston
    MS-Off Ver
    Excel 2011
    Posts
    2

    Re: Formula to look for multiples of a number in a range

    Thanks for your reply. Much appreciated.
    For some reason, it doesn't work...here is what I get using both formulas provided above: - use C1, instead of A1 to show the formula.
    3 6 9 12 15 18 21 24
    =MOD(C1,4)<>C1 FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
    =IF(MOD(C1,4)<>C1,"yes","no") no yes yes yes yes yes yes yes

    If it were true, then for the range of numbers from 12-15, it should be "FALSE" or "no" as that range only contains 13, 14, 15.

    Thank you.

  4. #4
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Formula to look for multiples of a number in a range

    insert a row at 1, then try this in whatever column,row 2 you need the answer:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Drag down

    Hope this helps
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  5. #5
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Formula to look for multiples of a number in a range

    so if what i understand is correct, try this array formula:
    =IF(MIN(MOD(ROW(INDIRECT(C1-2&":"&C1)),4)),"no","yes")

    you have to paste the formula inside the formula bar & press CTRL + SHIFT + ENTER

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1