+ Reply to Thread
Results 1 to 7 of 7

Count and addition formulas

  1. #1
    Forum Contributor
    Join Date
    03-24-2010
    Location
    North West UK
    MS-Off Ver
    2013
    Posts
    112

    Count and addition formulas

    Hi guys,

    I have a spreadsheet (attached) and in it I have a lot of raw data. What I want to do is this:

    I've started a table in column K and what I want to do is put a formula in under the three headings for each month (KM, Tonnes & Trips). What I want the formulas to do is if column E contains the word WASTE and column A also contains a date in January then add the all the KM's in column G for January and put that in column L for January. Then using the same criteria but adding up all the tonnes in column F put that in the January total in column M. Where it states Trips in column N, trips would be the count of every line that is for January (providing that column A contains a date in January for 2014 and the word WASTE appears in column E).

    I'm sure then I can duplicate it for the rest of the months as I need this for the whole of 2014.

    Any help would be much appreciated.

    Thanks,
    Lew
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Count and addition formulas

    Column G contains the word VOID so this will create an error with SUMPRODUCT, that column must all be numbers
    Move the word VOID to another column and this will work

    in L5
    =SUMPRODUCT((TEXT(A2:A50000,"mmmm")=K5)*(G$2:G$50000))

    in M5
    =SUMPRODUCT((TEXT(A2:A50000,"mmmm")=K5)*(F$2:F$50000))

    in N5
    =SUMPRODUCT(--(TEXT(A2:A8,"mmmm")=K5)*(E$2:E$8="WASTE"))

    and copy down the columns
    Last edited by Special-K; 05-01-2018 at 10:36 AM.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Count and addition formulas

    Hi Star Trek Fan - Lew


    A Pivot Table might do exactly what you need. See the attached. You can group the dates, like I've done or filter them for only showing 2014.


    Waste Filter in Pivot Table.xlsx

    I needed to remove 2016 dates to make the sheet small enough to attach. I hope you get the idea.

    Time to learn Pivot Tables? http://www.excelfunctions.net/Excel-...-Tutorial.html
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Contributor
    Join Date
    03-24-2010
    Location
    North West UK
    MS-Off Ver
    2013
    Posts
    112

    Re: Count and addition formulas

    Thanks but that doesn't seem to work I just get #VALUE! could it be that the data in A:A is in date format?

  5. #5
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Count and addition formulas

    My mistake I was still testing column N

    1. Move the VOIDs in column G to another column or you will get a #VALUE error

    2.
    in L5
    =SUMPRODUCT((TEXT(A2:A50000,"yyyy")+0=$K$4)*(TEXT(A2:A50000,"mmmm")=K5)*(G$2:G$50000))
    in M5
    =SUMPRODUCT((TEXT(A2:A50000,"yyyy")+0=$K$4)*(TEXT(A2:A50000,"mmmm")=K5)*(F$2:F$50000))
    in N5
    =SUMPRODUCT(--(TEXT(A2:A50000,"yyyy")+0=$K$4)*(TEXT(A2:A50000,"mmmm")=K5)*(E$2:E$50000="WASTE"))

    copy down the columns

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Count and addition formulas

    maybe this way
    done with PowerQuery

    btw. each column should have the same type of data, not mixed
    Attached Files Attached Files
    Last edited by sandy666; 05-01-2018 at 01:32 PM. Reason: update for all included years

  7. #7
    Forum Contributor
    Join Date
    03-24-2010
    Location
    North West UK
    MS-Off Ver
    2013
    Posts
    112

    Re: Count and addition formulas

    Thanks guys, works a treat, much appreciated

+ 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. Basic Addition Formulas
    By MichelleAssistsYou in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-07-2017, 12:19 AM
  2. Replies: 12
    Last Post: 01-27-2015, 08:10 PM
  3. Apply formulas on row Addition/deletion
    By linok in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-10-2014, 07:20 AM
  4. [SOLVED] New Addition of Can you read and count? in Profile Page
    By :) Sixthsense :) in forum The Water Cooler
    Replies: 6
    Last Post: 05-09-2014, 10:41 AM
  5. Random number count and addition with macros/formulas
    By aiims in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 08-06-2013, 07:48 PM
  6. Is there a shortcut to addition formulas?
    By salford69 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 05-09-2007, 01:40 PM
  7. [SOLVED] Same Question with one more addition of a dash to count
    By Mahendra in forum Excel General
    Replies: 0
    Last Post: 08-04-2005, 07:05 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