+ Reply to Thread
Results 1 to 2 of 2

Offset function giving a #N/A error when no data in the range

  1. #1
    Registered User
    Join Date
    12-28-2014
    Location
    Birmingham, England
    MS-Off Ver
    2010
    Posts
    54

    Offset function giving a #N/A error when no data in the range

    Hi

    Please help to resolve my query.

    I have data in a pivot with months as column headers and rows with client name. I need to determine
    how many months since the last order. I am using the offset and match function to determine the last occurring value in a row but when a client has no orders for the months from Jan 14 until Mar 15 i.e (no pivot data), the offset function is giving me a #N/A error. How can i resolve this?

    Formula =(MATCH(TEXT(Data!$K$2, "mmm-yy"),$B$4:$Y$4,0)-MATCH(LOOKUP(2,1/(OFFSET($B$4:$Y$4,MATCH(A8,$A$5:$A$930,0),)<>""),$B$4:$Y$4),$B$4:$Y$4,0))

    B4:Y4 = Range of the pivot columns (months)
    A5:A930 = Range of the pivot rows (Clients)

    The Bold section of the formula is giving me the current Month position in the pivot.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Offset function giving a #N/A error when no data in the range

    What result do you want to replace the error?

    This will return a blank:

    =IFERROR(your formula here,"")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. [SOLVED] Vlookup giving an error after a MAX, Offset
    By mchambersusmc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-24-2015, 11:30 AM
  2. [SOLVED] Using Offset function as the array in the PercentRank function is giving wrong result
    By Bobneil in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-06-2013, 09:29 PM
  3. Replies: 2
    Last Post: 06-03-2013, 08:26 AM
  4. [SOLVED] offset of variable giving error
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2013, 09:43 AM
  5. [SOLVED] Range error in code, runs alone but not inside my full program, giving runtime error 1004
    By charizzardd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2012, 03:34 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