+ Reply to Thread
Results 1 to 10 of 10

Problem with ISODD and other function when used in array formulas.

  1. #1
    Registered User
    Join Date
    06-17-2020
    Location
    Lisbon, Portugal
    MS-Off Ver
    2016
    Posts
    5

    Angry Problem with ISODD and other function when used in array formulas.

    If i use this array formula:

    Please Login or Register  to view this content.
    I get a nice array back but, if I use it over a range I doesn't work

    Please Login or Register  to view this content.
    1.png

    If I transpose the range twice it works, which doesn't make any sense to me

    Please Login or Register  to view this content.
    2.png

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Problem with ISODD and other function when used in array formulas.

    I would imagine it's to do with the fact that ISODD is treating the range as 2-dimensional (i.e. 1 to 1, 1 to 5), unlike the (horizontal) array constant (1x5)

    the two transpositions would convert the (1 to 1, 1 to 5) to 1-dimensional array (1 to 5)

    in VBA terms

    Please Login or Register  to view this content.
    FWIW, you could seemingly do the same with MOD without the need for TRANSPOSE - i.e. =(MOD(B3:F3,2)=0)+0 {CSE}

  3. #3
    Registered User
    Join Date
    06-17-2020
    Location
    Lisbon, Portugal
    MS-Off Ver
    2016
    Posts
    5

    Re: Problem with ISODD and other function when used in array formulas.

    Yeah i would imagine that is the problem also. But actually it still doesn't make a lot of sense to me that it works with the MOD function and not the ISODD function...

    This does work.

    Please Login or Register  to view this content.
    Attachment 682921

    I would image that all functions would have the same behavior but ISODD for example gives #VALUE! error as soon as it gets the range.

    I would like to understand the why as I'm "studying array formulas" because I made a small evaluation engine that understands excel formulas and in my engine that works fine but in excel it doesn't. so users have some problems when they try the same folumas in excel.
    Attached Images Attached Images
    Last edited by pfigueiredo; 06-17-2020 at 08:03 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    490

    Re: Problem with ISODD and other function when used in array formulas.

    Hasn't that to do with what function can properly coerce arrays?

    Maybe XL XOR or Bo_Ry can better explain, try: =IF(ISODD(N(IF(1,B2:F2))),0,1)

    Is that what you were looking for?

    Although I find festing for ISODD and then marking the even numbers with 1 strange?
    Why not use ISEVEN then?

  5. #5
    Registered User
    Join Date
    06-17-2020
    Location
    Lisbon, Portugal
    MS-Off Ver
    2016
    Posts
    5

    Re: Problem with ISODD and other function when used in array formulas.

    Using ISODD was just a test case I didn't expect the formula to make any sense.

    Anyway is there any documentation on functions that don't properly coerce arrays?

    Found some insight here:

    excelxor.com/2014/11/04/coercing-array-returns-from-cse-resistant-formulas/

    Any more info is appreciate.

    But may thanks for all the help.
    Last edited by pfigueiredo; 06-17-2020 at 08:39 AM. Reason: Some extra information found googleing

  6. #6
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Problem with ISODD and other function when used in array formulas.

    yes, just FYI, the author is @XOR LX - as referenced by @RaulSerg above.

    I was reading some older posts too where it was also noted that, for whatever reason, the older EVEN and ODD functions do work with Arrays

    B4:F4: =(EVEN(B3:F3)=B3:F3)+0

    https://www.excelforum.com/excel-gen...-of-cells.html

    of course, this doesn't resolve your underlying issue, but adds to the weirdness - and so 'interesting' nonetheless... (for some of us!)

  7. #7
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    490

    Re: Problem with ISODD and other function when used in array formulas.

    Hi, I think my previous formula was off.

    Can you try this and see if that works for you?

    =N(ISODD(+$F$6:$J$6))

    or if you prefer =--ISODD(+$F$6:$J$6)

    The + is crucial in the formula.
    Last edited by RaulSerg; 06-17-2020 at 10:38 AM.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Problem with ISODD and other function when used in array formulas.

    It just seems some functions' native behavior is to accept the first value in a range only. This is particularly true of all the date functions as near as I have seen. The rest of the values must be coerced. I use just the "+" =IF(ISODD(+B3:F3),0,1)

    I also picked that up from XOR LX.

    It also works for coercing text ranges.

    FWIW XOR LX has a host of articles RE: Array coercion. Many of the solutions offered by other contributors in the challenges sections reveal a lot of additional techniques.


    Have fun!
    Dave

  9. #9
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    490

    Re: Problem with ISODD and other function when used in array formulas.

    As an additional piece of information, even in Excel365 with dynamic arrays e.g. =ISODD(+F13:J13) spills correctly but also only if the unary + is included, too.

  10. #10
    Registered User
    Join Date
    06-17-2020
    Location
    Lisbon, Portugal
    MS-Off Ver
    2016
    Posts
    5

    Re: Problem with ISODD and other function when used in array formulas.

    This is a Fantastic comunity you guys are awesome!

    Thanks for all the insights on this!

+ 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. Replies: 3
    Last Post: 07-17-2017, 07:25 AM
  2. [SOLVED] Array Formulas Limitatins - Could be PC memory size problem
    By Spiros in forum Excel General
    Replies: 17
    Last Post: 08-09-2016, 03:15 PM
  3. Problem Array Formulas with VLOOKUP
    By gamerongvangtp in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-15-2014, 04:17 AM
  4. [SOLVED] Array formulas to create a sub list - a problem I can't fix
    By SidneyFAlco in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-16-2013, 02:19 PM
  5. Excel 2007 : Array formulas condition problem-bug!
    By luckylooke in forum Excel General
    Replies: 11
    Last Post: 01-02-2011, 02:14 PM
  6. #name? error when using ISEVEN and ISODD formulas
    By stir-crazy in forum Excel General
    Replies: 4
    Last Post: 06-29-2007, 04:08 PM
  7. Problem with Array Formulas and ISNUMBER
    By Henrik in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-09-2005, 09:06 PM

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