+ Reply to Thread
Results 1 to 15 of 15

The N function and the idiosyncrasies of Excel

  1. #1
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    The N function and the idiosyncrasies of Excel

    Wow, this is news to me: https://exceljet.net/formula/return-...index-function

    Has this been known for a very long time? I recall i saw some N function swooshing by recently somewhere but didn't think anything of it. Today I took on a task of summarizing a column of numbers that was in different currencies. After some pointless wrestling with lookup and what not I learned what must be one of the weirdest tricks in Excel.

    I'm not sure this causing me to love Excel more or hate Excel more...

    It also makes me wonder what Excel would look like if it was written from scratch today with all the experiences gathered from this forum and all the other users worldwide. For sure it would be easier to use INDEX/MATCH in an array formula...
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: The N function and the idiosyncrasies of Excel

    I wrote on that over four and a half years ago:

    https://excelxor.com/2014/09/05/inde...ray-of-values/

    I first saw it in a thread on this very forum, maybe 5 years ago, from a Chinese member. And Lori then traced it back to some Chinese Excel forums. Not sure how it was originally discovered, though.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: The N function and the idiosyncrasies of Excel

    Ok, interesting. Excel is a weird beast.

  4. #4
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: The N function and the idiosyncrasies of Excel

    I came across that same exceljet link earlier this year. I think my reaction was similar to yours, Jacc. "Wow, that's so cool!" followed by "Why the hell can't it do this natively?"
    If someone helped achieve your solution, consider clicking "* Add Reputation" on their post.

    If your question has been answered, mark the thread as [SOLVED] using the Thread Tools menu at the top of the thread.

  5. #5
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: The N function and the idiosyncrasies of Excel

    Ha ha... yeah, you don't wether to laugh or cry!

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: The N function and the idiosyncrasies of Excel

    Last edited by snb; 05-04-2019 at 01:19 PM.



  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: The N function and the idiosyncrasies of Excel

    @snb
    My browser ( FF) returned a " Potential security risk" warning when clicking on your link
    It's in French - Sorry
    Attached Images Attached Images

  8. #8
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: The N function and the idiosyncrasies of Excel

    @pepe

    Pas de problème: continuez sans peur ou utilizez le 'link' http sans 's'
    Le site est le plus innocente possible.

  9. #9
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: The N function and the idiosyncrasies of Excel

    Quote Originally Posted by snb View Post
    Nice!
    I was reminded of this old thread and the impressive solution of apo: https://www.excelforum.com/excel-pro...ml#post4138397

    Revisited the thread and lo and behold, he links right back to your site.

  10. #10
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: The N function and the idiosyncrasies of Excel

    Quote Originally Posted by XOR LX View Post
    I wrote on that over four and a half years ago:

    https://excelxor.com/2014/09/05/inde...ray-of-values/

    I first saw it in a thread on this very forum, maybe 5 years ago, from a Chinese member. And Lori then traced it back to some Chinese Excel forums. Not sure how it was originally discovered, though.

    Regards
    T function as well?!? Oh man...


    And what is the difference between IF(1,.... and IF({1},.... ?

    https://www.excelforum.com/excel-for...g-headers.html

  11. #11
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: The N function and the idiosyncrasies of Excel

    And why will this not work?
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I'm trying to solve this: https://exceljet.net/puzzle/formula-...o-days-of-week

  12. #12
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: The N function and the idiosyncrasies of Excel

    Actually the IF{1) could be replaced with the unary plus operator in the example in that link, i.e.:

    =SUMPRODUCT(N(+'Raw Data'!$B:$B),N(+'Raw Data'!$A:$A),N('Raw Data'!$A:$A>=B2))-SUMPRODUCT(N(+'Raw Data'!$B:$B),N(+'Raw Data'!$A:$A),N('Raw Data'!$A:$A>B3))

    Re {1}, I should have included that in my post. Basically, if the values form part of a range (as opposed to hard-coded values as part of an array constant) then {1} is required. For example, with B1, B2 and B3 containing 1, 4 and 8 respectively:

    =SUM(INDEX(A1:A10,N(IF({1},B1:B3))))

    is equivalent to:

    =SUM(INDEX(A1:A10,N(IF(1,{1,4,8}))))

    Regards

  13. #13
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: The N function and the idiosyncrasies of Excel

    Quote Originally Posted by Jacc View Post
    And why will this not work? =TEXTJOIN("",1,IF(MID($A$1,(ROW(INDIRECT("1:7"))),1)="Y",INDEX($A$6:$A$12,IF({1},N(ROW(INDIRECT("1:7")))))),"")
    As in the previous examples, the N (highlighted red) goes before the IF, not before (in this case) ROW.

    Regards

  14. #14
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: The N function and the idiosyncrasies of Excel

    Jeez... that could have taken days for me to discover. Thanks!

  15. #15
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: The N function and the idiosyncrasies of Excel

    Quote Originally Posted by XOR LX View Post
    Actually the IF{1) could be replaced with the unary plus operator in the example in that link, i.e.:

    =SUMPRODUCT(N(+'Raw Data'!$B:$B),N(+'Raw Data'!$A:$A),N('Raw Data'!$A:$A>=B2))-SUMPRODUCT(N(+'Raw Data'!$B:$B),N(+'Raw Data'!$A:$A),N('Raw Data'!$A:$A>B3))
    Why is + enough in that case?

+ 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. COUNTUNIQUE Function in Google Sheets; Excel lacks a direct counterpart to this function?
    By PivotTablePSHomage in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2018, 05:27 AM
  2. Excel VBA Function Method API Windows Function User32.dll Alias Declare Library List . :)
    By Doc.AElstein in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-17-2018, 07:51 PM
  3. Replies: 4
    Last Post: 04-24-2014, 11:56 AM
  4. Replies: 13
    Last Post: 04-08-2014, 05:46 AM
  5. Replies: 1
    Last Post: 03-21-2012, 11:22 AM
  6. Replies: 2
    Last Post: 03-30-2009, 04:04 AM
  7. [SOLVED] Excel - User Defined Function Error: This function takes no argume
    By BruceInCalgary in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2006, 04: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