+ Reply to Thread
Results 1 to 4 of 4

Using blank cells in mathematical operations

  1. #1
    Forum Contributor
    Join Date
    03-03-2007
    Posts
    101

    Using blank cells in mathematical operations

    I got myself in a bind. Attached is an example of my problem.

    I learned that Excel will allow the use of blank cells in mathematical operations. However, it won't allow a cell that appears blank but has a formula in it to also be used in mathematical operations. See cell B3 and you'll see what I mean. Is there a way to make it work? Many thanks.
    Attached Files Attached Files

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    You could try tools > options > view tab > untick zero values and then you won't need the if statements in B1 & B2 or try

    =IF(ISERROR(B2-B1),0,24*(B2-B1))
    or
    =IF(COUNT(B1:B2)=0,0,B2-B1)
    formatted as C1

    Please Login or Register  to view this content.
    VBA Noob
    Last edited by VBA Noob; 01-01-2008 at 05:30 PM.
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Contributor corinereyes's Avatar
    Join Date
    12-02-2003
    Location
    Philippines
    MS-Off Ver
    MS Excel 2016
    Posts
    520
    or:

    B1: =IF(N(A1)=0,N(0),A1)
    B2: =IF(N(A2)=0,N(0),A2)

    then try VBA Noob's suggestion ->
    You could try tools > options > view tab > untick zero values and then you won't need the if statements in B1 & B2
    Corine

  4. #4
    Forum Contributor
    Join Date
    03-03-2007
    Posts
    101
    Thanks, that did the trick. I will use

    =24*(N(B2)-N(B1))

    in cell B3.

+ 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