+ Reply to Thread
Results 1 to 5 of 5

Modify this array formula to correct #Num error

  1. #1
    Registered User
    Join Date
    06-16-2011
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    40

    Modify this array formula to correct #Num error

    I'm creating a worksheet using excel 2007. In column A I've calendar weeks from 1 to 52. In column F I'm using user form to select an entry from the list. Now in order to do some calculation in column J, I've written an array
    formula. I'm trying to implement the following logic using this formula:

    1st condition:
    if the value in column A matches with the value of column A in previous row;
    Condition passes....
    Then check
    if the value in Column F has occurred for the 1st time for similar value of column A
    Condition passes....
    Then, the value in Jx = ((20-Hx)/20)

    2nd Condition:
    if the value in column A is not equal to the value of column A in previous row;
    Condition passes.....
    Then , the value in Jx = ((20-Hx)/20)

    Jx and Hx could be J2, H2 or J3, H3 etc. depending upon the calculation.

    3rd Condition:
    if the value in column A matches with the value of column A in previous row;
    Condition passes....
    Then check
    if the value in column F has occured earlier for similar value of column A
    Condition passes.....
    Then, the value in Jx = Jy-(Ix*100)

    Jy denotes the value of J where the Fx has occured last time.


    This is the formula which goes in J5. But it throws #NUM error.

    =IF(AND($A$2:$A4=A5,MATCH(F5,F:F,0)=ROW()),((20-H5)/20),INDEX(J$2:J4,SMALL(IF(F$2:F5=F5,ROW(F$2:F5)),COUNTIF(F$2:F5,F5)-1)-1,1)-I5)

    I've also attached the excel for reference.
    Attached Files Attached Files
    Last edited by daymaker; 07-13-2011 at 12:01 PM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Modify this array formula to correct #Num error

    Not to clear on your expected results.

    See if this in J2 works for you.
    Please Login or Register  to view this content.
    Drag/Fill Down.

    Hope this helps.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Modify this array formula to correct #Num error

    There seems to be inconsistencies...

    AND($A$2:$A4=A5,....)... checks each of A2:A4 for a match (when in an array formula)... is that want you want or do you want just AND($A4=A5,.....)

    Condition 1 and condition 2 seem to result in same outcome, Jx = ((20-Hx)/20) even though first you say "if the value in column A matches with the value of column A in previous row" and "if the value in column A is not equal to the value of column A in previous row".. which are opposite conditions....

    This 3rd condition formula: Jx = Jy-(Ix*100) doesn't seem to appear in your final formula.

    A5 in your worksheet is not equal to anything prior, so what is the expected outcome in J5? and why?

    So please review your conditions, and then perhaps show some expected results so we can better assist you.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Modify this array formula to correct #Num error

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!

    Read this to understand why we ask you to do this, then please add links to your crossposts.
    Remember what the dormouse said
    Feed your head

  5. #5
    Registered User
    Join Date
    06-16-2011
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: Modify this array formula to correct #Num error

    Thanks a lot Marcol!!! It works perfectly....

    Sorry about the cross post...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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