+ Reply to Thread
Results 1 to 7 of 7

Function problem: Function correct but not running

Hybrid View

helterskelter101 Function problem: Function... 09-02-2018, 05:00 AM
jason.b75 Re: Function problem 09-02-2018, 05:15 AM
FDibbins Re: Function problem:... 09-03-2018, 01:37 AM
romperstomper Re: Function problem:... 09-03-2018, 04:05 AM
jason.b75 Re: Function problem:... 09-03-2018, 10:56 AM
helterskelter101 Re: Function problem:... 09-04-2018, 10:17 AM
helterskelter101 Re: Function problem:... 09-04-2018, 10:07 AM
  1. #1
    Registered User
    Join Date
    09-02-2018
    Location
    Maastricht, Netherlands
    MS-Off Ver
    365 ProPlus
    Posts
    3

    Function problem: Function correct but not running

    Hi! I need to match data from two excell sheets. To achieve this I wrote the following function:
    =INDEX(Opnames!$F:$F;MATCH(1;INDEX((F6<=Opnames!$F:$F)*(G6>=Opnames!$E:$E)*(B6=Opnames!$A:$A);0);0))

    This function works, buttttttttt...
    When I run it for an individual data entry there are no problems. It either gives me the data I'm looking for or NA when there is no available match (this is a likely outcome for many data entries). But once I run the function for all my data entries (25000 or so) it only returns NA's... When I manually execute the function there are no problems, but running it like this doesn't work. Does anybody have a clue how I can fix this?
    I added an example down below.

    Cheers!
    Attached Files Attached Files
    Last edited by helterskelter101; 09-02-2018 at 08:33 AM.

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Function problem

    Thanks for updating your thread title
    Last edited by jason.b75; 09-03-2018 at 10:13 AM. Reason: Moderation request removed.

  3. #3
    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
    53,048

    Re: Function problem: Function correct but not running

    Looks like that is an ARRAY formula ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    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

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,978

    Re: Function problem: Function correct but not running

    The second INDEX negates the need for array entry.

    The formula results look correct for the data in that file. Can you indicate one that you think should return something but doesn't? (Also, are you sure you have automatic calculation set?)
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Function problem: Function correct but not running

    Just to point out, N/A and #N/A are not the same thing.

    #N/A is the formula returning an error, not returning one of the N/A's from the other sheet. This can sometimes cause a knock on effect, one error creates another where a result might be expected, although I can't see anything to suggest that is happening here.

    Also, whole columns in array formulas Even though the formula is not CSE confirmed, the nature of it is still an array, calculating over 1 million empty rows!

    Try formatting the data in the Opnames sheet as a table, then use this formula in J2 instead.

    =INDEX(Table1[Opname 12],MATCH(1,INDEX(($F2<=INDEX(Table1[[Opname 1]:[Opname 78]],COLUMNS($J2:J2)))*($G2>=INDEX(Table1[[Opname 1]:[Opname 78]],COLUMNS($J2:J2)))*($B2=Table1[UserName]),0),0))

    It gives the same results as yours, just more efficiently.

    To help you get the results that you want, please refer to rorya's post above.

  6. #6
    Registered User
    Join Date
    09-02-2018
    Location
    Maastricht, Netherlands
    MS-Off Ver
    365 ProPlus
    Posts
    3

    Re: Function problem: Function correct but not running

    Quote Originally Posted by jason.b75 View Post
    Just to point out, N/A and #N/A are not the same thing.

    #N/A is the formula returning an error, not returning one of the N/A's from the other sheet. This can sometimes cause a knock on effect, one error creates another where a result might be expected, although I can't see anything to suggest that is happening here.

    I added the NA's later in the opnames tab, they weren't there before but it returend the same

  7. #7
    Registered User
    Join Date
    09-02-2018
    Location
    Maastricht, Netherlands
    MS-Off Ver
    365 ProPlus
    Posts
    3

    Re: Function problem: Function correct but not running

    Hi guys! I'm gonna try to implement your suggestions today Thanks for the advice and I will let you know if I get any results. I'm a bit of a rookie with regards to this so thanks!
    Last edited by helterskelter101; 09-04-2018 at 10:17 AM.

+ 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. [VBA] Problem with outmail function - function sends mails only to 1 recepient
    By sauron12 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-21-2015, 03:30 PM
  2. Replies: 6
    Last Post: 10-20-2013, 07:16 PM
  3. Problem Inserting Round function into an IF function
    By Ash87 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-11-2013, 05:37 PM
  4. [SOLVED] problem with 'IF' function
    By BobbyH in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-23-2012, 11:42 PM
  5. IF function problem
    By rebelyell in forum Excel General
    Replies: 3
    Last Post: 06-22-2012, 09:03 AM
  6. [SOLVED] IF function Problem
    By ericinarcata in forum Excel General
    Replies: 6
    Last Post: 04-25-2012, 07:26 PM
  7. if Function problem
    By jerry in forum Excel General
    Replies: 8
    Last Post: 10-03-2005, 02: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