+ Reply to Thread
Results 1 to 3 of 3

Output Boolean Array from User-Defined Function

  1. #1
    Registered User
    Join Date
    08-23-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    18

    Question Output Boolean Array from User-Defined Function

    I would like to write a function that outputs an array (or range of zeros and ones) that tells me whether the target range cells (in a column) are bold or not. I then want to take this array and perform a sumproduct with another array of zeros and ones.

    For example:
    Please Login or Register  to view this content.
    Ultimately, I'd like to have a cell with the following formula: SUMPRODUCT(A1:A5,B1:B5,BoldArray(B1:B5)). The reason I'm not doing all of this in one function is because I need the target ranges to float automatically as the spreadsheet expands/contracts. For example, A1:A5 may be A10:A54 at some point in the future.

    Thanks!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Output Boolean Array from User-Defined Function

    I think maybe you are confusing Functions & Procedures.

    A Function can accept an argument and return a value but it can't change or format a cell.

    Use
    Please Login or Register  to view this content.
    instead
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Output Boolean Array from User-Defined Function

    You were close.

    Please Login or Register  to view this content.
    E.g., select A1:C5 and array-enter =IsBold(D1:F5)
    Entia non sunt multiplicanda sine necessitate

+ 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. Passing an array in a user defined function
    By Peter M in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-16-2013, 01:15 AM
  2. User defined function to output multiple values
    By firefly2k8 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-20-2010, 12:03 PM
  3. user defined function using Array
    By Dennisli2000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-18-2007, 02:00 PM
  4. [SOLVED] Returning formatted output from a User defined function
    By Salman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-14-2006, 03:05 AM
  5. [SOLVED] How to output an array in Excel with a user-defined function?
    By Andy Chan in forum Excel General
    Replies: 2
    Last Post: 12-30-2005, 04:10 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