+ Reply to Thread
Results 1 to 3 of 3

Display content of cell if other cells are empty otherwise perform SUM

  1. #1
    Forum Contributor
    Join Date
    11-20-2008
    Location
    UK
    Posts
    132

    Question Display content of cell if other cells are empty otherwise perform SUM

    I'm only just beginning to get to grips with Excel and have hit a bit of a problem that I can't solve because I don't really understand what the formula I'm using actually does.

    I have a range of cells, F14:F26, which track what page someone is up to in a book, so each time they read a book they enter the page they are up to in the next row of that range.

    Another cell, F6 displays the total number of pages in that book.

    I then have another cell, G5, which works out how many pages there are left to be read and for that I use this formula:

    =SUM(F6-(INDEX(F14:F26,MATCH(9.99999999999999E+307,F14:F26))))

    This works fine as long as something has been entered into one of the cells F14:F26 but if someone hasn't started to read that book then G6 displays #N/A because nothing has been entered in F14:F26.

    What I would like is for G6 to display F6 if F14:F26 are empty but then to use the above formula IF something has been entered. The trouble is I got the above formula from another website and I don't fully understand exactly what it is doing which makes changing it to do what I need a bit tricky!

    Anyone know how I can amend the formula to work how I need?

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Display content of cell if other cells are empty otherwise perform SUM

    Try:

    =IF(COUNT(F14:F26)=0, F6, SUM(F6-(INDEX(F14:F26,MATCH(9.99999999999999E+307,F14:F26)))))

  3. #3
    Forum Contributor
    Join Date
    11-20-2008
    Location
    UK
    Posts
    132

    Re: Display content of cell if other cells are empty otherwise perform SUM

    Quote Originally Posted by zbor View Post
    Try:

    =IF(COUNT(F14:F26)=0, F6, SUM(F6-(INDEX(F14:F26,MATCH(9.99999999999999E+307,F14:F26)))))
    You are a STAR!!

    I've been staring at that formula for ages waiting for the coffee to kick in but without success.

    Thank you so much, you've saved me from getting any balder

+ 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