+ Reply to Thread
Results 1 to 6 of 6

please help to calculate how often a number appears and calculate total value

  1. #1
    Registered User
    Join Date
    06-10-2017
    Location
    UK
    MS-Off Ver
    NA
    Posts
    4

    please help to calculate how often a number appears and calculate total value

    hi everyone

    i need some help and im not sure how to word it so apologies if i dont make much sence

    i have data from a stock take and it totals 798 row. using this data i need to see how offten the unique code appears in the data and then gather the total quantity from the next column. eg below

    uniqe code -------------- quantity
    4017267948919 ............. .10
    4017267948777................7
    4017267942222...... .....76
    4017267948777................54
    4017267948919 ...............55
    4017267942222............3

    would it be possible to get the result on a new sheet in the format of

    unique code ................ . total
    4017267942222.............79


    once again thanks alot and any help would be greatly appricated


    mukhtar
    Last edited by mukhtar1211; 06-10-2017 at 07:32 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: please help to calculate how often a number appears and calculate total value

    Use the =countif function

    look at this tutorial

    https://www.techonthenet.com/excel/formulas/countif.php
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    06-10-2017
    Location
    UK
    MS-Off Ver
    NA
    Posts
    4

    Re: please help to calculate how often a number appears and calculate total value

    hi alan

    thanks for the super fast responce

    please may you help me a little more

    im trying figure it out and i can get it to tell me how many times the code appears but how would i then tell it to added to quanity in the next coloumn and give me a total.

    thanks

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

    Re: please help to calculate how often a number appears and calculate total value

    Maybe with PivotTable
    Attached Files Attached Files

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: please help to calculate how often a number appears and calculate total value

    Hi mukhtar1211 - The attached workbook demonstrates how to list and summarize your data.

    Data worksheet holds 30 rows of random codes and quantities.
    Summary worksheet:

    Column A= a complete list of unique codes. This ARRAY FORMULA in A2:
    =IFERROR(INDEX(Data!$A$2:$A$31,MATCH(0,COUNTIF($A$1:$A1,Data!$A$2:$A$31),0)),"")

    Column B= total quantity associated w each code. This regular formula in B2:
    =IF(A2="","",SUMIF(Data!$A$2:$A$31,Summary!A2,Data!$B$2:$B$31))

    Hope this meets your requirements. - Lee

    NOTE: When pasting or editing an ARRAY FORMULA in the formula bar, you must press CTRL+SHIFT+ENTER to confirm entry.
    Then use the drag handle to copy the cell down or across.


    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Attached Files Attached Files
    Last edited by leelnich; 06-11-2017 at 12:30 AM.

  6. #6
    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,936

    Re: please help to calculate how often a number appears and calculate total value

    Quote Originally Posted by mukhtar1211 View Post
    hi alan

    thanks for the super fast responce

    please may you help me a little more

    im trying figure it out and i can get it to tell me how many times the code appears but how would i then tell it to added to quanity in the next coloumn and give me a total.

    thanks
    If you have already managed to get COUNTIF to work, the next step would be to use SUMIF() to run the totals, based on the exact same criteria as the COUNTIF
    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

+ 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. Calculate total number of submissions
    By Shamz41 in forum Excel General
    Replies: 4
    Last Post: 01-16-2017, 08:29 PM
  2. Calculate total number of submissions
    By Shamz41 in forum Excel General
    Replies: 1
    Last Post: 01-16-2017, 06:14 AM
  3. [SOLVED] total number of months calculate
    By arindamsenaxa in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-07-2015, 06:01 AM
  4. I need to calculate how many times a number appears on the sheet
    By topdealz in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 01-01-2015, 07:32 AM
  5. Replies: 1
    Last Post: 07-18-2013, 10:11 AM
  6. [SOLVED] Calculate the total number if certain conditions are met
    By beaker28 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-11-2012, 09:32 AM
  7. [SOLVED] HOW TO CALCULATE 2/10 OF 1 PERCENT OF A TOTAL NUMBER?
    By AMANDA RILEY in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-26-2006, 08:10 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