|
-
Feb 24th, 2009, 01:07 AM
#1
Thread Starter
PowerPoster
[RESOLVED] Analyzing an Excel worksheet.
Hi all,
I've an excel sheet of 3 columns. I want to collect some information like follows. Basically count occurrence of a range.
=COUNTIF(B:B, "<100")
=COUNTIF(B:B, "<200")
=COUNTIF(B:B, "<300")
=COUNTIF(B:B, "<500")
=COUNTIF(B:B, "<700")
=COUNTIF(B:B, "<1000")
=COUNTIF(B:B, "<1500")
=COUNTIF(B:B, "<2000")
something like that. May be you are not clear, on column B I have some values. I want to calculate each count as above and put them in cells.
Can anyone give me a solution. Doing it manually is a real mess.
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
-
Feb 24th, 2009, 02:53 AM
#2
Re: Analyzing an Excel worksheet.
vb Code:
Sub CountOccurances()
'~~> Depending upon your conditions change this
Dim Ar(7) As String
Ar(0) = "<100"
Ar(1) = "<200"
Ar(2) = "<300"
Ar(3) = "<500"
Ar(4) = "<700"
Ar(5) = "<1000"
Ar(6) = "<1500"
Ar(7) = "<2000"
'~~> Storing the formula, starting from C1
For i = 0 To UBound(Ar)
Sheets("Sheet1").Range("C" & i + 1).Value = _
"=COUNTIF(B:B, " & """" & Ar(i) & """" & ")"
Next
End Sub
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Feb 24th, 2009, 03:32 AM
#3
Thread Starter
PowerPoster
Re: Analyzing an Excel worksheet.
Thanks, actually I've solve the question with macros. Thanks for the comment lol.
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|