+ Reply to Thread
Results 1 to 5 of 5

IF date value returned from Index/Match is blank, return prior cell that returns a value

  1. #1
    Registered User
    Join Date
    03-27-2014
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    IF date value returned from Index/Match is blank, return prior cell that returns a value

    Hi all,

    I have set up the attached spreadsheet to track sales in relation to selling days. An Index/Match formula is setup to return a value of how many selling days have progressed based on looking up the actual day of the month minus one day, and matching the month .

    My problem is, when it looks up a day that is not a sales day (blank cell) by referencing L2, it doesnt return a value. I need a formula which says if a blank value is returned when matching the day in L2, return the value of the most recent selling day. This would be the prior cell with a value in it.

    Eg. September 14 returns a blank, I need it to return the value for September 12 (the most recent selling day)

    All help appreciated

    Cheers
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: IF date value returned from Index/Match is blank, return prior cell that returns a val

    Something like this perhaps in P7:

    =MAX(OFFSET($J$13, 1, MATCH($K$2, $K$13:$U$13, 0), $L$2, ))


    Change your formula in S7:

    =IFERROR(K7/P7,"")
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: IF date value returned from Index/Match is blank, return prior cell that returns a val

    Try this,

    =MAX(INDEX(K$14:U$44,1,MATCH(TEXT(K$5,"mmmm"),K$13:M$13,0)):INDEX(K$14:U$44,DAY(K5),MATCH(TEXT(K$5,"mmmm"),K$13:M$13,0)))
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: IF date value returned from Index/Match is blank, return prior cell that returns a val

    Instead of that big table and the index/match needed to pull the days worked, try this in P7 instead...
    =NETWORKDAYS(EOMONTH(TODAY(),-1),TODAY()-1)

    You can test it by changing the last -1 to +1 (10 days), then to +2 (10 days), +3 (10 days), +4 (11 days)
    You would only need to use =NETWORKDAYS(EOMONTH(TODAY(),-1),TODAY()-1) though, just to make sure you understand
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    03-27-2014
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: IF date value returned from Index/Match is blank, return prior cell that returns a val

    Thanks all, I will give this a go

+ 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. Index/ Match Formula, How to return blank cell as a blank not 0
    By MDResearcher in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-24-2016, 08:40 PM
  2. Replies: 2
    Last Post: 08-16-2012, 09:00 AM
  3. Calculate month to date returns, index and match
    By nickmangan in forum Excel General
    Replies: 2
    Last Post: 07-13-2012, 07:01 AM
  4. Index/Match to return a blank cell
    By Nick_in_Dubai in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-26-2012, 06:36 AM
  5. Replies: 3
    Last Post: 08-17-2010, 02:54 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