+ Reply to Thread
Results 1 to 4 of 4

Ensuring one number is a whole number greater than the other

Hybrid View

  1. #1
    Registered User
    Join Date
    10-14-2008
    Location
    halifax
    Posts
    2

    Ensuring one number is a whole number greater than the other

    Hi, im trying to sort a little spreadsheet out for my work and have come to a dead end with this problem. I have two figures, (i.e. 3.5 & 5) but i need to make the difference between the two figures a whole number, (i.e. 1or 2 or 3). So i would have to change the 3.5 - 5 to 3.5 - 5.5.
    eg

    2.5 - 4.5 ok
    1.5 - 4 1.5 - 4.5
    4.5 - 6 4.5 - 6.5
    3 - 4 ok

    I think i need to use the =mod function but can't get my head around the equation needed.

    Any help much appreciated

    Regards
    Key

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699
    It's easier if you have the values in separate cells so say you have the lower value in A2 and the higher in B2, i.e. 3.5 in A2 and 5 in B2, then this formula in C2 will give the value that B2 needs to be so that the difference is an integer

    =CEILING(B2-A2,1)+A2

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Or =A2 + ROUND(B2-A2, 0)

    The formulas will give different results depending on the inputs ...
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    10-14-2008
    Location
    halifax
    Posts
    2

    Sorted

    Thanks guys, ended up using Daddylonglegs's equation within mine, I had to round up the answer to the nearest half and then ensure it was a whole number greater than D3

    =(CEILING(CEILING(S3/U3, 0.5)-D3,1)+D3)

    not sure I needed both ceiling functions but the end result was the correct one so thanks for all your help.
    Regards

    Key

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Update from one workbook to another
    By dvspriest in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-08-2008, 09:50 PM
  2. Replies: 6
    Last Post: 07-29-2008, 03:23 PM
  3. count the number of members in cells seperated by ;
    By wali in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-23-2008, 01:46 PM
  4. Replies: 4
    Last Post: 06-13-2007, 12:24 AM
  5. Determining required number of contacts
    By Bobcalling in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-10-2007, 01:27 PM

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