+ Reply to Thread
Results 1 to 18 of 18

I need a formula to count each x as a value, totaled below.

  1. #1
    Registered User
    Join Date
    01-26-2009
    Location
    seattle, washington
    MS-Off Ver
    Mac Excel 2011
    Posts
    19

    I need a formula to count each x as a value, totaled below.

    Hi Guys,

    I have a spreadsheet that we use to evaluate weighted client info, we have either a 10, 5, -5 or -15 in column B that we want to be counted at the bottom of the page ever time there is an x in any of the cells to the right. So its something like (for every time there is an x in this column we add the cooresponding value from column B) These values could be 10, 5, -5 etc.

    Basically it should be a countif any cells in this column have an x, add the value from the same row to the totals.

    I was thinking =COUNTIF(A1:A10,"*x*") but its not working right.

    Thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    04-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, 2019, Office 365, Google Spreadhsheet
    Posts
    640

    Re: I need a formula to count each x as a value, totaled below.

    Hi there,

    What I have understood that you are trying to get the corresponding count against each value if the next cell is containing "x".

    Please see image in line if it solve your purpose.

    I have taken value in column "B" and text containing "x" in column "C". Then I looked up for the criteria.

    countif.png
    Thanks,
    Anil Dhawan


    Click *Add Reputation to say "Thanks" and don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved) if you are satisfied.

    Don't stop when you are tired. STOP when you are done!

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: I need a formula to count each x as a value, totaled below.

    COUNTIF will do just that - count stuff.

    I think what you need is sumif(). Something like...
    =sumif(C:C,"x",B:B)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    04-20-2015
    Location
    Egypt
    MS-Off Ver
    2010
    Posts
    22

    Re: I need a formula to count each x as a value, totaled below.

    Could you attach the worksheet please

  5. #5
    Registered User
    Join Date
    01-26-2009
    Location
    seattle, washington
    MS-Off Ver
    Mac Excel 2011
    Posts
    19

    Re: I need a formula to count each x as a value, totaled below.

    hi adhawan06, you are real close, instead focus on the calculation of values column d. instead of 1 or 0 in column d that is where we have the x or leave it blank.

    So the formula would be more like... if any rows in column d have an x, then add the value in same row @ column B & then add it at the bottom of column d.
    Some kind of count if function for all of column D.

  6. #6
    Registered User
    Join Date
    01-26-2009
    Location
    seattle, washington
    MS-Off Ver
    Mac Excel 2011
    Posts
    19

    Re: I need a formula to count each x as a value, totaled below.

    Here is a test of the data we are looking to model.

    If x appears in column D add corresponding value from column c & add them up in row "totals" for each client type in columns d thru k.
    Attached Images Attached Images
    Attached Files Attached Files

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: I need a formula to count each x as a value, totaled below.

    Please upload a sample of your workbook, not a picture of your data. Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you
    Also, not all members can upload picture files (Company firewalls and stuff) - and, depending on what browser is being used, some pics dont even show up on the forum

    Your workbook should show a small desensitized example of the data you are working with and a manual mockup of the expected results.

    It sounds though, that you need something like...

    =sumif(D:D,"X",C:C)

    If you need to do that for specfic clients, then something like this instead...

    =sumifS(C:C,D:D,"X",K:K=K2))

  8. #8
    Valued Forum Contributor
    Join Date
    04-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, 2019, Office 365, Google Spreadhsheet
    Posts
    640

    Re: I need a formula to count each x as a value, totaled below.

    Agreed with @FDibbins kindly upload your data in excel file as picture may not give much clarity.

    It sounds that you wanted to have sum in the same column at the last row of each column starting from D. Type Following Formula

    I am Assuming you have data starts B3 to K20 (As rows number are hidden )

    Grand Total in D22 - Type :
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and drag it to the right till column K.

    Hope this is what is what you are looking for.



    Cheers!!!

    Anil Dhawan

  9. #9
    Valued Forum Contributor
    Join Date
    04-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, 2019, Office 365, Google Spreadhsheet
    Posts
    640

    Re: I need a formula to count each x as a value, totaled below.

    Quote Originally Posted by FDibbins View Post
    Please upload a sample of your workbook, not a picture of your data. Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you
    Also, not all members can upload picture files (Company firewalls and stuff) - and, depending on what browser is being used, some pics dont even show up on the forum

    Your workbook should show a small desensitized example of the data you are working with and a manual mockup of the expected results.

    It sounds though, that you need something like...

    =sumif(D:D,"X",C:C)

    If you need to do that for specfic clients, then something like this instead...

    =sumifS(C:C,D:D,"X",K:K=K2))
    Hi Ford,

    Just wanted to quick check, if I use formula given by you in D20, then the function will return to circular reference? correct me if i am wrong. As per my knowledge, you can't type an formula in the same column or row which you are considering as criteria. Please correct my understanding.

    Thanks,

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: I need a formula to count each x as a value, totaled below.

    Quote Originally Posted by adhawan06 View Post
    Hi Ford,

    Just wanted to quick check, if I use formula given by you in D20, then the function will return to circular reference? correct me if i am wrong. As per my knowledge, you can't type an formula in the same column or row which you are considering as criteria. Please correct my understanding.

    Thanks,
    Yes, you are absolutely correct. I could not see the sample pic provided, I can now. So my suggestion needs to be adjusted so that the range is not a full column range, but is, instead, the specific range covering the data

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: I need a formula to count each x as a value, totaled below.

    adhawan06, thank you so much for the kind words and rep points, much appreciated

  12. #12
    Forum Contributor
    Join Date
    05-06-2015
    Location
    Sri Lanka
    MS-Off Ver
    2016, 2007
    Posts
    135

    Re: I need a formula to count each x as a value, totaled below.

    by pivoting your data table, you can do all the things that you are saying you need to do. does that count?

  13. #13
    Registered User
    Join Date
    01-26-2009
    Location
    seattle, washington
    MS-Off Ver
    Mac Excel 2011
    Posts
    19

    Re: I need a formula to count each x as a value, totaled below.

    Thanks Guys the =sumif(D:D,"X",C:C) formula is 90% of what I was looking for and I adjusted it to fit.

    Thanks for helping

  14. #14
    Valued Forum Contributor
    Join Date
    04-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, 2019, Office 365, Google Spreadhsheet
    Posts
    640

    Re: I need a formula to count each x as a value, totaled below.

    Hey there,

    If your query has been resolved, mark this thread as SOLVED and say thanks to those who helped you by adding *Add Reputation.

    Thanks,
    Anil Dhawan

  15. #15
    Registered User
    Join Date
    01-26-2009
    Location
    seattle, washington
    MS-Off Ver
    Mac Excel 2011
    Posts
    19

    Re: I need a formula to count each x as a value, totaled below.

    Dineth... question on your pivot table comment.

    I'm a new when it comes to excel, is there a step a b c for pivot tables. something that is less techie or is this a VBA coding thing?

  16. #16
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: I need a formula to count each x as a value, totaled below.

    Quote Originally Posted by excelstone View Post
    Dineth... question on your pivot table comment.

    I'm a new when it comes to excel, is there a step a b c for pivot tables. something that is less techie or is this a VBA coding thing?
    PT's are generally pretty simple.

    1. make sure all your data have headings
    2. Make sure there are no empty columns (Add a dummy heading if there are)
    3. Highlight the range
    4. Select Pivot Table from the Insert tab
    5. play around with the table by drag/drop headings into columns and rows

  17. #17
    Forum Contributor
    Join Date
    05-06-2015
    Location
    Sri Lanka
    MS-Off Ver
    2016, 2007
    Posts
    135

    Re: I need a formula to count each x as a value, totaled below.

    Pivot Tables let you to analyze, summarize and visualyze your data as required. It is a powerful and useful tool and I strongly suggest you to be familiar with it for many advantages.

    To use a pivot table, first you have to have a table that you are going to 'pivot'.
    in your case, it's your data-table. make sure your table is in proper format. (i.e single row headers, no merge cells etc.) then you can pivot it.

    after pivoting, you have your layout and variables. you can drag and drop your variables to rows and columns to get desired layout, you can filter data as well as you can summarize it.

    pathway to do this is slightly different with excel version, I am using excel 2013, there to make a table home tab -> styles group -> format as a table.
    to pivot, insert tab -> tables group -> pivot table.

  18. #18
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: I need a formula to count each x as a value, totaled below.

    step by step on setting up a pivot table

    http://www.excel-easy.com/data-analy...ot-tables.html
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ 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. Working with sub-totaled data
    By Ray A in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-06-2005, 06:05 PM
  2. [SOLVED] Working with sub-totaled data
    By itchy777 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  3. Working with sub-totaled data
    By itchy777 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  4. [SOLVED] Working with sub-totaled data
    By itchy777 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  5. [SOLVED] Working with sub-totaled data
    By itchy777 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM

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