• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Search results

  1. L

    Find a series of numbers that appear in any order

    Hi David, That works better but I'm not 100% sure about it due to decimal approximations. It leads me to one final idea that only compares whole numbers... Replace EXP(n) with the n th prime number and multiply! =PRODUCT(CHOOSE(H1:K1,1,2,3,5,7)) i.e. 1*1*1*2 and the number of matches in the...
  2. L

    Find a series of numbers that appear in any order

    Further testing shows all previous EXP formulas should really be adjusted to a wider tolerance, so instead of: =SUM(EXP({3,3,3,1}))=SUM(EXP({1,3,3,3})) which returns FALSE, use something like: =ABS(SUM(EXP({3,3,3,1})-SUM(EXP({1,3,3,3}))<1E-12
  3. L

    Find a series of numbers that appear in any order

    Indeed you're right, that MATCH formula only works reliably with unique criteria. But then COUNTIF is not reliable in general either eg 1, 1, 1, 1 could match criteria 1, 1, 2, 2 with that kind of logic. Alternatively, a formula that combines the two approaches could work well for any data type...
  4. L

    Find a series of numbers that appear in any order

    Hi David, I think the first alternative you give does better than the second for non-zero integers. eg 1, 2, 2, 37 and 1, 2, 2, 36 will be matched in the formula above. But thanks for the interesting idea. Anyone else interested in the theory behind the formula can follow the proof that e is...
  5. L

    Find a series of numbers that appear in any order

    Hi David, It's a nice idea in theory based, i believe, on the principle that exp(n) is not a linear combination of any lower powers {exp(1),..,exp(n-1)} i.e. e is a transcendental number which was first shown in 1882 (https://en.wikipedia.org/wiki/Transcendental_number). For example it would...
  6. L

    XIRR with Inflows and Outflows on Different Sheets

    Hi @Rushikesh Ambekar . Try this variation: =XIRR(IF({1,0},G5:G8,INDEX(-L5:L8,)),IF({1,0},C5:C8,H5:H8))
  7. L

    XIRR with Inflows and Outflows on Different Sheets

    For three ranges use CHOOSE({1,2,3} instead. IF is just used in the case of two ranges for brevity.
  8. L

    XIRR with Inflows and Outflows on Different Sheets

    This might work for you with CTRL+SHIFT+ENTER: =XIRR(IF({1,0},G5:G8,-L5:L8),IF({1,0},C5:C8,H5:H8)) In the original attachment you can also try entering: =XIRR(IF({1;0},B9:F9,B12:F12),IF({1;0},B8:F8,B11:F11))
  9. L

    Excel function reference

    Playing around with these ideas further, another option is to define 'p' as, =ROW()-MIN(ROW())+1 This returns a reference-free 1-based when array-entered in a range. Then array-enter: =IFERROR(INDEX(...,p),"") where ... is any formula that returns an array (which can be much more efficient...
  10. L

    Excel function reference

    Nice! I like the unicode naming convention and the technique to reference shapes from formulas. Combining INDEX with IFERROR to remove errors in the return array is new to me and could be useful in lots of situations (by inserting an extra IF function if necessary as mentioned previoisly). From...
  11. L

    Excel function reference

    Your digressions sound interesting - perhaps you could attach a demo file? In a simplified set up containing first and last names in A1:B5, this multi-cell version: =IFERROR(IF(1,INDEX(A1:B5,{1;3;4},)),"") can be entered into D1:E5 using CSE to return a subset of these names. I'm not quite...
  12. L

    Excel function reference

    I'd agree that when a function has named formulas as arguments it is often preferable to enter over a range of cells with CSE than to enter individual cell formulas. This can cut down on time consuming recalculations of names like in your definition of pointer. Open document format specifies...
  13. L

    Excel function reference

    @Peter Bartholomew - Indeed array processing can be applied generally to such value arguments - whether that's a good thing or not is open to debate. I noticed on the EuSprig website an article by an author with the same name deprecating the use of such array formulas in practice. Your...
  14. L

    All Combination of Numbers that Equal to a given Sum-NON VBA

    Surekha - please try the code samples provided. Both NarayanK's and my suggestion use the replace method to work around the formula length limitation.
  15. L

    All Combination of Numbers that Equal to a given Sum-NON VBA

    Sub ArrayFormula() With Sheet1.Range("C3:H10") .FormulaArray = _ "=INT(MOD(MOD(SMALL(ABS(#REF!)+ROW(B2:INDEX(B:B,2^ROWS(B3:B10))),C2:H2),10^7)/2^(ROW(B3:B10)-ROW(B2)-1),2))" .Replace "#REF!", _...
  16. L

    IF within SUMPRODUCT

    Here are a few further notes relating to the questions raised above... First off, contrary to what I said previously, tests on various formulas in the attachment indicate there is no significant difference with using CSE on formulas and that multi-cell array formulas can be fastest for...
  17. L

    IF within SUMPRODUCT

    @NARAYANK991, Yeah that wasn't phrased very clearly. What i meant was the time span from first day to last day. Another interpretation could be length of a work contract from first day to last worked and blanks are vacation or sick days. @Naceur, you could also use "*" in place of "~x" (but...
  18. L

    Extract whole words of some length

    Hi @callao2908, As the formula returns more than one result you can use INDEX to get the other values: =INDEX(FILTERXML("<x><a>"&SUBSTITUTE(A2," ","</a><a>")&"</a></x>","//*[string-length(text()) = 2]"),2) Not sure what that would be in Spanish?
  19. L

    IF within SUMPRODUCT

    i thought of a better example to illustrate the "trickiness" of the IF function... Suppose you want to find attendance for a course from first day to last in columns A and B (where days attended are marked with an "x" and blank otherwise): 01-Sep 04-Sep x 05-Sep x 06-Sep 07-Sep x 08-Sep...
  20. L

    Extract whole words of some length

    Another option (for use in Excel 2013+) to return an array containing text elements of a given length: =FILTERXML("<x><a>"&SUBSTITUTE(TRIM(A2)," ","</a><a>")&"</a></x>","//*[string-length(text()) = 2]") eg: A2 = "a ss ddd ffff ggg hh j" -> {"ss";"hh"}
  21. L

    VlookUp in Vba

    Perhaps worth adding that this kind of operation could also be done in one "single hit": Sheet2.[B2:B8]=Application.Vlookup(Sheet2.[A2:B8],Sheet1.[A2:B8],2,0) To make this dynamic either replace the references with ranges similar to method above or using Names/Table references.
  22. L

    IF within SUMPRODUCT

    @Naceur: Your example does raise some interesting points. Here is my 2 cents: Ctrl+Shift+Enter. As others have said fixes the issues, but may be a bit slower to recalculate. In my experience even adding a few extra functions to avoid CSE can be faster and is also more efficient when copying...
  23. L

    Excel function reference

    Ah, thanks for that clarification. i tried to make the list as comprehensive as possible - 600 functions in all (including little known ones such as NUMBERSTRING and DATESTRING used in far east versions.) A slicer was added to show only the more common ones but i had forgotten this is only...
  24. L

    Excel function reference

    The first sheet of the FuncList workbook attachment contains a formatted list of all functions and arguments and was created by copying the last two columns from the List sheet as text and pasting into the table. Array types are shown in bold; Reference types are shown in italics Value types...
  25. L

    How can fetch column heading for each row

    Nice technique. Maybe worth noting one can remove the N() function: =IFERROR(INDEX(Sheet2!$B$1:$I$1,AGGREGATE(15,6,COLUMN(Sheet2!$B$1:$I$1)-1/Sheet2!$B2:$I2,IF(1,ROW(Sheet2!$A$1:$A$8)))),"") That said, with only 8 names it'd be simpler and more efficient to just fill down...
Back
Top