+ Reply to Thread
Results 1 to 7 of 7

Need Help Making a Formula or Correct Function to Use

Hybrid View

  1. #1
    Registered User
    Join Date
    12-19-2022
    Location
    Georgia
    MS-Off Ver
    MS Office 2016
    Posts
    2

    Need Help Making a Formula or Correct Function to Use

    Hello All,

    I am trying to make a formula, but I am having a hard time putting it into words. So I will give an example:


    excel.PNG


    I would like it to have the format above and only output the the values of certain counties in the column. So in the example Baldwin and Mobile are the counties that I wanted the values for, not Jefferson, so the AL Total will only include Mobile and Baldwin because those values are my relevant information.

    What function would I use to set this up? For reference I will be using this on excel sheets with thousands of rows of data, I am tired of filtering and through the data for hours when I feel like excel can do it for me in seconds..

    Thanks for any help in advance!

  2. #2
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,185

    Re: Need Help Making a Formula or Correct Function to Use

    You could probably use SUMIFS or SUMPRODUCT.
    Please read the yellow banner at the top of the page if you need more info, and attach a sample.

  3. #3
    Registered User
    Join Date
    12-19-2022
    Location
    Georgia
    MS-Off Ver
    MS Office 2016
    Posts
    2

    Re: Need Help Making a Formula or Correct Function to Use

    sample.xlsx

    Attaching a workbook for additional help, new to excel so I think it is easier for me to understand when I can see it in action!

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: Need Help Making a Formula or Correct Function to Use

    There was a slight error in the first formula that I gave you (it's always better to attach a sample file). It should be this in B10:

    =SUMIF(B$2:B$5,LEFT($A10,FIND(" ",$A10)-1),C$2:C$5)

    which should be copied into B11, and then the other formula goes into B9 , as stated.

    Hope this helps.

    Pete

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: Need Help Making a Formula or Correct Function to Use

    Assuming "State Code" is in cell A1, you can use this formula in cell B10:

    =SUMIF(B$2:B$5,LEFT($A10,FIND(" ",$A10)-1),B$2:B$5)

    and you can copy this into cell B11. Use this formula in cell B9:

    =SUM(B10:B11)

    Hope this helps.

    Pete

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Need Help Making a Formula or Correct Function to Use

    Another option, try in B10 and copy down:
    Formula: copy to clipboard
    =SUM(C$2:C$5*(B$2:B$5=LEFT(A10,LEN(A10)-7)))
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,185

    Re: Need Help Making a Formula or Correct Function to Use

    Since you said you have 1000's of rows of data, I'm assuming you may have the same county name in different states. If that's the case, to be on the safe side, I would just add this to HansDouwe formula:

    =SUM(C$2:C$5*(B$2:B$5=LEFT(A10,LEN(A10)-7))*(A$2:A$5=LEFT($A$9,LEN($A$9)-7)))

+ 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. Looking for the correct formula or function
    By Tresix in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 07-07-2017, 07:12 PM
  2. Stuck on correct function(s) & formula!
    By minorcatherine1 in forum Excel Formulas & Functions
    Replies: 47
    Last Post: 09-28-2016, 04:02 AM
  3. Indirect function formula not correct
    By trobie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-12-2013, 08:30 AM
  4. Making Excel to pickup correct value?
    By mrwadi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-02-2012, 06:57 PM
  5. Making sure the data is put on the correct row.
    By jsgray in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-15-2010, 01:15 PM
  6. Replies: 2
    Last Post: 11-24-2008, 05:09 PM
  7. [SOLVED] Making Excel Calculate In Correct Order
    By Carl Bowman in forum Excel General
    Replies: 1
    Last Post: 02-15-2005, 12:06 AM

Tags for this Thread

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