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 947001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:00:42+00:00 2026-05-15T23:00:42+00:00

The first three columns exist. I am trying to create a formula for the

  • 0

The first three columns exist. I am trying to create a formula for the fourth (HH_ANALYSIS_FLAG).

ACCOUNT_NUMBER   HOUSEHOLD_NUMBER   ACCOUNT_ANALYSIS_FLAG   HH_ANALYSIS_FLAG
1001             1                  1                       0
1002             2                  0                       0
1003             3                  1                       0
1004             3                  0                       0
1005             3                  0                       0
1006             2                  0                       0
1007             4                  0                       0
1008             1                  1                       0

I have 50,000 accounts. They are flagged as being under analysis with the ACCOUNT_ANALYSIS_FLAG column (0,1). All accounts belong to a household. Multiple accounts can belong to the same household. I need the HH_ANALYSIS_FLAG column to evaluate to true or false (0,1) if any account in the same household is under analysis. So with the above data and a working formula, my spreadsheet would look like so:

ACCOUNT_NUMBER   HOUSEHOLD_NUMBER   ACCOUNT_ANALYSIS_FLAG   HH_ANALYSIS_FLAG
1001             1                  1                       1
1002             2                  0                       0
1003             3                  1                       1
1004             3                  0                       1
1005             3                  0                       1
1006             2                  0                       0
1007             4                  0                       0
1008             1                  1                       1
  • 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-05-15T23:00:43+00:00Added an answer on May 15, 2026 at 11:00 pm

    The following formula should do the trick. In fact, it will give you the total number of accounts being analysed per household.

        A        B       C                  D
    1   ACC_NUM  HH_NUM  ACC_ANALYSIS_FLAG  HH_ANALYSIS_FLAG      
    2   1001     1       1                  =SUMIF(B$2:B$50001, B2, C$2:c$50001)
    3   1002     2       0                  =SUMIF(B$2:B$50001, B3, C$2:c$50001)
    4   1003     3       1                  =SUMIF(B$2:B$50001, B4, C$2:c$50001)
    

    For each row this takes selects the set of rows that share the value in the ACC_NUM column (based on the row conaining the formula) and sums together the values in the corresponding ACC_ANALYSIS_FLAG columns. This gives you the total number of accounts under analysis for the given household. Compare the result to 0 if you only need to use it as a boolean value.

    EDIT:

    Apparently the performance of this isn’t up to snuff. However, assuming the the household numbers are all colocated, it should be possible to speed things up significantly by changin to something like the following.

    2    1001     1       1                  =SUMIF(B2:B5,  B2, C2:C5)
    3    1002     2       0                  =SUMIF(B2:B6,  B3, C2:C6)
    4    1003     2       0                  =SUMIF(B2:B7,  B3, C2:C7)
    5    1004     2       0                  =SUMIF(B2:B8,  B3, C2:C8)
    6    1005     2       0                  =SUMIF(B3:B9,  B3, C3:C9)
    7    1006     2       0                  =SUMIF(B4:B10, B3, C4:C10)
    8    1007     2       0                  =SUMIF(B5:B11, B3, C5:C11)
    9    1008     2       0                  =SUMIF(B6:B12, B3, C6:C12)
    10   1009     2       0                  =SUMIF(B7:B13, B3, C7:C13)
    

    This assumes that there are at most 4 accounts per household, and thus limits the range of the SUMIF to the current cell +/- 3 rows.

    To avoid referencing invalid cells you’ll the first and last rows have to be treated as special cases. If you need to generate a single forumala for all of these cells I think it should be possible using the OFFSET in combination with MAX, MIN and ROW to generate the appropriate ranges with just a little arithmatic.

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

Sidebar

Related Questions

I have three columns in my table - company_name, first_name, last_name . In the
Is there any Java library that supports hierarchical column? For example (the first three
First is there any technique for using Action Script for recording sound from microphone?
First of all there is a partial question regarding this, but it is not
When I need some complex algorithm I first check if there's anything relevant already
First off, there's a bit of background to this issue available on my blog:
First, I know there are methods off of the generic List<> class already in
Is there an easy way to capitalize the first letter of a string and
Is there a CIL instruction to exchange the first two elements in the stack?
Is there way in next piece of code to only get the first record?

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.