Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8051725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:21:55+00:00 2026-06-05T07:21:55+00:00

I have a custom function defined that extracts part of an address from a

  • 0

I have a custom function defined that extracts part of an address from a string:

/*
 * Return the number preceding 'N' in an address
 *    '445 N 400 E' => '445'
 *    '1083 E 500 N' => '500'
 */
function NorthAddress(address) {
  if (!address) return null;
  else {
    var North = new RegExp('([0-9]+)[\\s]+N');
    var match = address.match(North);
    if (match && match.length >= 2) {
      return match[1];
    }
    return null;
  }
}

I want to use this function as one of the conditions in a call to FILTER(...) in the spreadsheet where I have these addresses stored:

=FILTER('Sheet 1'!A:A, NorthAddress('Sheet 1'!B:B) >= 450))

But when I call NorthAddress like this, it gets an array of all the values in column B and I can’t for the life of me find any documentation as to how I need to handle that. The most obvious way (to me) doesn’t seem to work: iterate over the array calling NorthAddress on each value, and return an array of the results.

What does my function need to return for FILTER to work as expected?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:21:56+00:00Added an answer on June 5, 2026 at 7:21 am

    When a custom function is called passing a multi-cell range, it receives a matrix of values (2d array), it’s doesn’t matter if the range is a single column or a single row, it’s always a matrix. And you should return a matrix as well.

    Anyway, I would not use a custom function to this, as there is already the native spreadsheet formulas: RegexMatch, RegexExtract and RegexReplace formulas. To get the “if match” behavior, just wrap them in a IfError formula.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function that I set custom key and value to it and
I'd like to call a custom function that is defined in a Python module
I have defined a custom type as follows: -- Atom reference number, x coordinate,
I have a custom button that calls the saveRow function. I want to put
I have a custom XML schema defined for page display that puts elements on
Aloha, I have a custom control that I need to instantiate from within a
I have a custom CustomMembershipUser that inherits from MembershipUser. public class ConfigMembershipUser : MembershipUser
I have a custom module that returns data from a web service call. It
I have been trying to get a custom Value from the Custom Field that
I have created a custom function and I am getting this error. I dont

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.