+ Reply to Thread
Results 1 to 11 of 11

How to automatically sum cell with some condition

  1. #1
    Registered User
    Join Date
    05-25-2021
    Location
    Philippines
    MS-Off Ver
    2019
    Posts
    12

    How to automatically sum cell with some condition

    Hi again and Good Afternoon!

    I hope someone can help....

    I would like to sum all the unhidden income of the household. Unfortunately I do not know how to set a command..

    What I want is to automatically sum all unhidden individual income to household income in every household.
    In column c Numbers represent as a household number. Number plus letters means it is a different family in that household but their individual income should be included in the household income since they live in a similar house.



    I dont know how to translate this to formula,., if column c has a number then add the individual income of rows until the last blank cell following

    Sample: if column c7 has a number then add column e7:12 excluding hidden cells then start again if
    c13 contains a number then sum e13:e18..

    Please see my attached sample.

    Thank you in advance
    Attached Files Attached Files
    Last edited by MushroomJ; 05-27-2021 at 03:16 AM.

  2. #2
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,039

    Re: How to automatically sum cell with some condition

    Change the function number from 9 to 109, formula =SUBTOTAL(109,E7:E12).

  3. #3
    Valued Forum Contributor
    Join Date
    03-24-2020
    Location
    Thailand
    MS-Off Ver
    Office 2016
    Posts
    897

    Re: How to automatically sum cell with some condition

    Hi there,

    You currently have in cell F7 the formula: =SUBTOTAL(9,E7:E12)
    Replace the 9 (sum) with 109 (sum visible): =SUBTOTAL(109,E7:E12)

    This will exclude the hidden cells in your range.
    If your Question is answered; please mark it SOLVED. If you are happy with a member's solution, say 'Thanks' and click the 'Star' to Add Reputation.

  4. #4
    Registered User
    Join Date
    05-25-2021
    Location
    Philippines
    MS-Off Ver
    2019
    Posts
    12

    Re: How to automatically sum cell with some condition

    Thanks for noticing.,

    Would you mind helping me solve the formula in F column?.

  5. #5
    Registered User
    Join Date
    05-25-2021
    Location
    Philippines
    MS-Off Ver
    2019
    Posts
    12

    Re: How to automatically sum cell with some condition

    Quote Originally Posted by josephteh View Post
    Change the function number from 9 to 109, formula =SUBTOTAL(109,E7:E12).
    Thank you..

  6. #6
    Valued Forum Contributor
    Join Date
    03-24-2020
    Location
    Thailand
    MS-Off Ver
    Office 2016
    Posts
    897

    Re: How to automatically sum cell with some condition

    Hi again,

    In cell F7, try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    then pull down.

    NOTE: for this formula to work, enter all values in column C as 'Text'
    Format cell as text and enter number, or as ` in front of number.
    The formula then will set the range to just before the next cell containng text.

  7. #7
    Registered User
    Join Date
    05-25-2021
    Location
    Philippines
    MS-Off Ver
    2019
    Posts
    12

    Re: How to automatically sum cell with some condition

    Quote Originally Posted by ORoos View Post
    Hi again,

    In cell F7, try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    then pull down.

    NOTE: for this formula to work, enter all values in column C as 'Text'
    Format cell as text and enter number, or as ` in front of number.
    The formula then will set the range to just before the next cell containng text.

    Hi... Your given formula really worked.

    What I observed is on the last household number., I need to put a text or ' in the last part in order for the formula to work for the lat household income.

    Since this column will be modified to text I will make this column as a helper.. Because at present, that column is used to count how many are household, in my checker i put a count and count a format to see the difference between household and familiar.

    Thank you so much...

  8. #8
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Taiwan
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,382

    Re: How to automatically sum cell with some condition

    worksheet name : District I , F7 cell formula , drag down

    HTML Code: 

  9. #9
    Registered User
    Join Date
    05-25-2021
    Location
    Philippines
    MS-Off Ver
    2019
    Posts
    12

    Re: How to automatically sum cell with some condition

    Quote Originally Posted by wk9128 View Post
    worksheet name : District I , F7 cell formula , drag down

    HTML Code: 
    Hi, I tried this formula but unfortunately it did not work. It did not sum the individual income of the household..

  10. #10
    Valued Forum Contributor
    Join Date
    03-24-2020
    Location
    Thailand
    MS-Off Ver
    Office 2016
    Posts
    897

    Re: How to automatically sum cell with some condition

    What I observed is on the last household number., I need to put a text or ' in the last part in order for the formula to work for the lat household income.
    Correct, there will be an error if no final value is found. You could go around this by wrapping the formula into an IFERROR statement and just make the last range X cells long (20 in the sample formula below).
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Thanks for the Rep

  11. #11
    Registered User
    Join Date
    05-25-2021
    Location
    Philippines
    MS-Off Ver
    2019
    Posts
    12

    Re: How to automatically sum cell with some condition

    Quote Originally Posted by ORoos View Post
    Correct, there will be an error if no final value is found. You could go around this by wrapping the formula into an IFERROR statement and just make the last range X cells long (20 in the sample formula below).
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Thanks for the Rep
    I tried this option.. This formula has same result however I will not need to put any value in the last household. I would rather use this formula than the first one.

    Thanks a lot.....
    Last edited by MushroomJ; 05-27-2021 at 11:43 PM.

+ 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. Need a If/Condition to adjust automatically based on value in a cell
    By Modify_inc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2019, 04:33 PM
  2. Replies: 2
    Last Post: 01-16-2019, 06:12 AM
  3. [SOLVED] Automatically Sommeprod if condition
    By Ayadin in forum Excel General
    Replies: 3
    Last Post: 07-08-2016, 03:47 PM
  4. Replies: 6
    Last Post: 04-01-2016, 09:31 AM
  5. Replies: 0
    Last Post: 03-10-2014, 05:19 AM
  6. Automatically copy data from one worksheet to another based on cell condition
    By ptt87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2011, 01:38 PM
  7. Replies: 2
    Last Post: 06-11-2008, 04:32 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