+ Reply to Thread
Results 1 to 6 of 6

Logic Statement

  1. #1
    Registered User
    Join Date
    02-20-2012
    Location
    Oxford, Ohio
    MS-Off Ver
    Excel 2011
    Posts
    2

    Post Logic Statement

    Knowing that an even number added to an even number results in an even number, an odd number added to an odd number results in an even number, and that an odd number added to an even number results in an odd number, how would i write a logic statement that will predict if the sum of any two integers is even or odd? The algorithm doesn't need to test for the actual sum, but just show if the sum of the two numbers will be an even or an odd number.

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Logic Statement

    like this??
    =IF(SUM(A1:B1)/2=INT(SUM(A1:B1)/2),"even","odd")

    A1 and B1 are the numbers to be added..
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Logic Statement

    Hi jeanmuhree,


    See the attachment. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    Attached Files Attached Files
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  4. #4
    Registered User
    Join Date
    02-20-2012
    Location
    Oxford, Ohio
    MS-Off Ver
    Excel 2011
    Posts
    2

    Re: Logic Statement

    Yes this worked! thank you!

  5. #5
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Logic Statement

    Thanks for the rep.
    look at also dilipandey sample for another approach ( -- used function mod() )

    If your problem is solved, please say so clearly, and mark your thread as Solved:
    Click the Edit button on your first post in the thread,
    Click Go Advanced,
    select [SOLVED] from the Prefix dropdown.

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Logic Statement

    Thanks vlady.. for considering / reviewing my solution as well.

    Cheers

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

+ 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