+ Reply to Thread
Results 1 to 10 of 10

ISNUMBER function in formula not returning expected value

  1. #1
    Forum Contributor
    Join Date
    08-20-2009
    Location
    Plymouth, England
    MS-Off Ver
    Excel 2013
    Posts
    149

    ISNUMBER function in formula not returning expected value

    Hi all,

    I have a spreadsheet that calculates how many hours overtime each staff member works on a particular day. However it is not returning the correct result. I have attached the worksheet. Cell E30 would be a good example. George doesn't work Mondays however he is working 8 hours. The cell continues to return 0 however. Any help would be greatly appreciated.

    Thanks,

    Lukewc 10 November 2013.xls
    Last edited by lukela85; 10-31-2013 at 10:26 AM.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Formula not returning expected result

    Merged cells do not work well with looping through a cell. I do not know if this is the case with formula though.

  3. #3
    Forum Contributor
    Join Date
    08-20-2009
    Location
    Plymouth, England
    MS-Off Ver
    Excel 2013
    Posts
    149

    Re: ISNUMBER function in formula not returning expected value

    It seems the ISNUMBER function does not recognise time in the format [h]:mm? Would this be why it always returns 0? The cells are all conditionally formatted to change all 0 returns to a white font color.

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: ISNUMBER function in formula not returning expected value

    Hi,

    Not sure why you think this. To me it's perfectly logical that this cell is returning 0, since you are using the ROUND function with a num_digits parameter of 0 on a value of 0.333333333333333, which evaluates to 0.

    Remove the ROUND function and the value in cell E30 is 8:00, as desired.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Forum Contributor
    Join Date
    08-20-2009
    Location
    Plymouth, England
    MS-Off Ver
    Excel 2013
    Posts
    149

    Re: ISNUMBER function in formula not returning expected value

    Thanks. All solved. My knowledge of Excel is very basic and I wasn't aware of significance of the num_digits parameter.

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: ISNUMBER function in formula not returning expected value

    Are you trying to round the result to the nearest hour?

  7. #7
    Forum Contributor
    Join Date
    08-20-2009
    Location
    Plymouth, England
    MS-Off Ver
    Excel 2013
    Posts
    149

    Re: ISNUMBER function in formula not returning expected value

    To the nearest 15 minutes. With a num_digits parameter of 15 it is currently doing this.

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: ISNUMBER function in formula not returning expected value

    Quote Originally Posted by lukela85 View Post
    To the nearest 15 minutes. With a num_digits parameter of 15 it is currently doing this.
    Are you sure?

    The syntax to round a time value to nearest 15 minutes would be

    =ROUND(TIME*24*4,0)/4/24

    Where time is the result of your existing formula without the round function.

  9. #9
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: ISNUMBER function in formula not returning expected value

    Yes. Be careful. A num_digits parameter of 15 does not at all mean that it is rounding to the nearest 15 minutes.

    This parameter is the number of decimal digits to which to round (and will not be affected by the number format of the cell).

    Regards

  10. #10
    Forum Contributor
    Join Date
    08-20-2009
    Location
    Plymouth, England
    MS-Off Ver
    Excel 2013
    Posts
    149

    Re: ISNUMBER function in formula not returning expected value

    I am using the following formula to calculate whether a staff member works any extra hours each day. However sometimes it returns a negative value and I have the cell in [h]:mm format so it doesn't return a value.

    =ROUND(IF(ISNUMBER(G39),H39-G39-'Hours Matrix'!D26-IF(AND(G39<0.500694444,H39>0.60416667),1/24,0),0),15)

    Using the formula above the staff member works from 12:00 until 17:00 which is her contract hours, so I would expect the formula to return 0. However it is returning a value of -0.04. Based on the responses in the posts above I'm using the wrong syntax however I'm not sure how to include this within the formula above.

+ 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. Replies: 4
    Last Post: 07-02-2013, 09:47 PM
  2. VLookup not returning expected result
    By tenscourts in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-20-2012, 10:04 AM
  3. COUNTIF not returning expected result
    By zpenacho in forum Excel General
    Replies: 3
    Last Post: 01-20-2012, 06:37 PM
  4. SUMIF - not returning expected result
    By Paul Sheppard in forum Excel General
    Replies: 4
    Last Post: 08-16-2011, 11:43 AM
  5. [SOLVED] Using sum(1/countif....) not returning expected result
    By Kent (thanks) in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 05-11-2006, 11:40 AM

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