Looking for a way to count a number set and update another cell with whatever that count is?

gnarwhal19

New Member
Joined
Aug 22, 2023
Messages
7
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
So first off, I'm extremely new to Excel so I apologize if I'm not using the correct terminology.

My query is this: I have a spreadsheet where I have to count how many times a certain number comes up and if so I have to tally how many times it shows.
For instance, I'll have a column with a cell that has a number in it for example "120" and I need to know how many sets of 50 show up in that cell. So this would have 2 (50s) in it as well as 1 (20) totaling 120. I'm wondering if there's a formula that can calculate how many times a group of "50" shows up in a given cell AND the remaining difference if there are any. Another problem I am working on is if a number is greater (>) than 6 or less than (<) 6 and how many times that shows up.

I have included a sample table so you can visualize the types of numbers I am working with, and if you need any clarification on what I'm asking for please just let me know.

Any help even if it's just sending me to another forum or watching a youtube video I don't mind, it's all appreciated!

Thank you.

forum test columns.xlsx
AB
12525
2
3
4
511,000
6
7
8
9
10125
11180
12250
1350
1411,6050
15
16
17100
18
19
20
21
22
230100
24
25
26150
27150
283000
29
30
31150
3235
3350
342
353
363
375
382
392
402
413
422
433
441
452
4650
4710
4825
490350
50
5111,930475
Sheet1
Cell Formulas
RangeFormula
A14:B14A14=SUM(A4:A13)
A23:B23A23=SUM(A17:A22)
A28:B28A28=SUM(A26:A27)
A49:B49A49=SUM(A31:A48)
A51:B51A51=SUM(A14+A23+A28+A49+A1)
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
from your example there are a few questions ...
- what column(s) should be searched for 50 ... A?
- column A contains numbers less than 50 any many greater than 50; should the values that are greater than 50 be divided by 50 to determine the "number of 50s" in the value.
- there are totals in both columns - is the part of what should be included in the count.
- the only values less than 6 are in column B (is this the column that should be counted for <6 and >6?

your description is a bit difficult to fully understand what you need. Please clarify.
 
Upvote 1
Welcome to the MrExcel board!

I agree that your questions are a little unclear, but see if these idea are headed in the right direction. If not, it might help indicate what further information (& examples of results) you need to give us.

23 08 23.xlsm
ABC
150sRemainder
2120220
325025
4110002200
5286536
6000
735070
8
9
10
11How many >=6How many <6
12853
135
142
156
169
1722
180
1915
20
Counts
Cell Formulas
RangeFormula
B2:B7B2=INT(A2/50)
C2:C7C2=MOD(A2,50)
B12B12=COUNTIF(A12:A19,">=6")
C12C12=COUNTIF(A12:A19,"<6")
 
Last edited:
Upvote 1
from your example there are a few questions ...
- what column(s) should be searched for 50 ... A?
- column A contains numbers less than 50 any many greater than 50; should the values that are greater than 50 be divided by 50 to determine the "number of 50s" in the value.
- there are totals in both columns - is the part of what should be included in the count.
- the only values less than 6 are in column B (is this the column that should be counted for <6 and >6?

your description is a bit difficult to fully understand what you need. Please clarify.
Thank you for trying to help but peter below is actually right on track with what I need!
 
Upvote 0
Welcome to the MrExcel board!

I agree that your questions are a little unclear, but see if these idea are headed in the right direction. If not, it might help indicate what further information (& examples of results) you need to give us.

23 08 23.xlsm
ABC
150sRemainder
2120220
325025
4110002200
5286536
6000
735070
8
9
10
11How many >=6How many <6
12853
135
142
156
169
1722
180
1915
20
Counts
Cell Formulas
RangeFormula
B2:B7B2=INT(A2/50)
C2:C7C2=MOD(A2,50)
B12B12=COUNTIF(A12:A19,">=6")
C12C12=COUNTIF(A12:A19,"<6")
Actually you are right on with this! I'm going to plug it into some of my spreadsheets to test. I'll leave my question up for now but I'll close it if this works for me.

thank you so much!
 
Upvote 0
Welcome to the MrExcel board!

I agree that your questions are a little unclear, but see if these idea are headed in the right direction. If not, it might help indicate what further indication (& examples of results) you need to give us.

23 08 23.xlsm
ABC
150sRemainder
2120220
325025
4110002200
5286536
6000
735070
8
9
10
11How many >=6How many <6
12853
135
142
156
169
1722
180
1915
20
Counts
Cell Formulas
RangeFormula
B2:B7B2=INT(A2/50)
C2:C7C2=MOD(A2,50)
B12B12=COUNTIF(A12:A19,">=6")
C12C12=COUNTIF(A12:A19,"<6")

This is so close to what i need I just don't have the knowledge of Excel to tell why it's just a bit off. When I run the INT formula you gave me it works perfectly on a single cell, but if I do it at a range it creates essentially another table for the spillover.

This is fine, but then I have to run a sum total to determine what I need in a given data set. Is this just how Excel works or is there a way to wrap everything in one formula to get the total I'm looking for? I've included a sample table to show you what I mean (I removed the grand totals from the previous example to keep it simple).

Or is there an easy way to remove the zeros so I can look at just the data I need?

The ">6/<6" is perfect and I probably should have been able to figure that out haha.

Thank you for all your help so far!

forum test columns.xlsx
ABCDEFGHIJKLMNOPQR
1
250Less506less6
3
4252500002525001712
500000000
600000000
700000000
811,0002200000000
900000000
1000000000
1140000080000
1200000000
13125200025000
14180300030000
1525050000000
165010000000
1700000000
1800000000
1910002000000
2000000000
2100000000
2200000000
2300000000
2400000000
2500000000
2600000000
2715030000000
2815030000000
2900000000
3000000000
3115003000000
3235000003500
335001000000
34200000200
35300000300
36300000300
37500000500
38200000200
39200000200
40200000200
41300000300
42200000200
43300000300
44100000100
45200000200
465001000000
4710000001000
4825000002500
Sheet2
Cell Formulas
RangeFormula
F4:I48F4=INT(A4:D48/50)
K4:N48K4=MOD(A4:D48,50)
P4P4=COUNTIF(A4:D48, ">=6")
R4R4=COUNTIF(A4:D48, "<6")
Dynamic array formulas.
 
Upvote 0
to get the total I'm looking for?
I'm not sure what total you are looking for.
Is it just these?
Excel Formula:
=SUM(INT(A4:D48/50))
Excel Formula:
=SUM(MOD(A4:D48,50))

If not, can you post the sample data again but remove those formulas and instead manually enter the result(s) that you are looking for and explain again in relation to that data/results.
 
Upvote 1
Solution
I'm not sure what total you are looking for.
Is it just these?
Excel Formula:
=SUM(INT(A4:D48/50))
Excel Formula:
=SUM(MOD(A4:D48,50))

If not, can you post the sample data again but remove those formulas and instead manually enter the result(s) that you are looking for and explain again in relation to that data/results.
It is what I'm looking for, I just have to combine it with a sum total to get exactly what I need.

Thank you for your help!
 
Upvote 0
You're welcome. Glad to help. Thanks for the follow-up. :)
 
Upvote 1

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top