+ Reply to Thread
Results 1 to 4 of 4

Ignore selected empty cells when using the XNPV function

  1. #1
    Registered User
    Join Date
    01-06-2015
    Location
    PH
    MS-Off Ver
    2010
    Posts
    3

    Ignore selected empty cells when using the XNPV function

    Hi, Is there some way wherein I can use the XNPV function as a general formula for a set of cells? To get the value of XNPV, the selected cells should only be the ones with values in it. But the other cells are cash flows which changes whenever I change the date, so I have to move the selected cells again to get the value. Is there some way where the formula ignores the other selected blank cells? Thanks so much!excel.png

  2. #2
    Registered User
    Join Date
    10-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Ignore selected empty cells when using the XNPV function

    I'm not familiar with XNPV, but on testing it has to have a date in every cell of the selected date range to work. I suspect there is a more efficient way of doing this, but the following formula will work by dynamically changing the ranges used by XNPV according to the contents of column B:

    =XNPV(C16,INDIRECT(ADDRESS(20,3)&":"&ADDRESS(ROW(B119)-COUNTIF(B20:B119,"-"),3)),INDIRECT(ADDRESS(20,2)&":"&ADDRESS(ROW(B119)-COUNTIF(B20:B119,"-"),2)))

    This assumes that your formulas in column B to bring through the date are setup to show a "-" if no date is bring through.
    Last edited by tricky01; 01-07-2015 at 05:35 AM.

  3. #3
    Registered User
    Join Date
    01-06-2015
    Location
    PH
    MS-Off Ver
    2010
    Posts
    3

    Re: Ignore selected empty cells when using the XNPV function

    It worked! I've been thinking about this on how to make it work for days now. Thanks so much for your response. I really appreciate it!

  4. #4
    Registered User
    Join Date
    10-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Ignore selected empty cells when using the XNPV function

    Quote Originally Posted by fitrader View Post
    It worked! I've been thinking about this on how to make it work for days now. Thanks so much for your response. I really appreciate it!
    Glad to have been able to help. The more time I spend on here though the more I expect there's a better more efficient way to do it - but at least that works []

+ 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. Ignore empty cells
    By nomis65 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2014, 10:13 PM
  2. Excel 2007 : Ignore empty cells? How?
    By PA0l0 in forum Excel General
    Replies: 3
    Last Post: 06-02-2011, 07:29 PM
  3. How to ignore empty cells in multiplication
    By bbheli in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 01-30-2011, 10:46 AM
  4. Can a formula ignore empty cells?
    By Melissa in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-31-2006, 01:30 PM
  5. [SOLVED] Trendline to ignore empty cells
    By Kara in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 06-09-2005, 01:05 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