ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   data find and add for summary (https://www.excelbanter.com/excel-programming/336174-data-find-add-summary.html)

TommySzalapski[_35_]

data find and add for summary
 

I have some data that looks something like this

Qty.......Qty Bad...Reason
34........2.........too long
45........0
44........4.........too short
54........3.........too long

I need to (in a macro) build a summary like
total number 177
too long 5
too short 4

I have a few ideas (for each row, if there is a reason, see if th
reason is in the summary yet and add it if not and add th
corresponding number to the running total)
I started coding this up and it looks messy and complicated and slow.
I can do it this way, but if someone feels like showing off his Exce
prowess and helping me out by giving me some ideas, I would appreciat
it.

thanks,
Tomm

--
TommySzalapsk
-----------------------------------------------------------------------
TommySzalapski's Profile: http://www.excelforum.com/member.php...fo&userid=2556
View this thread: http://www.excelforum.com/showthread.php?threadid=39225


Tom Ogilvy

data find and add for summary
 
Dim rng as Range, s as String, s1 as String, s2 as String
set rng = Range(Cells(2,1),Cells(rows.count,1).End(xlup))
s = "total nmber: " & rng.count
s1 = "too long: " & application.countif(rng.offset(0,2),"*long*")
s2 = "too short: " & application.countif(rng.offset(0,2),"*short*")

msgbox s & vbNewline & s1 & vbNewline & s2

--
Regards,
Tom Ogilvy

"TommySzalapski"
<TommySzalapski.1t5fb6_1123006014.0442@excelforu m-nospam.com wrote in
message news:TommySzalapski.1t5fb6_1123006014.0442@excelfo rum-nospam.com...

I have some data that looks something like this

Qty.......Qty Bad...Reason
34........2.........too long
45........0
44........4.........too short
54........3.........too long

I need to (in a macro) build a summary like
total number 177
too long 5
too short 4

I have a few ideas (for each row, if there is a reason, see if the
reason is in the summary yet and add it if not and add the
corresponding number to the running total)
I started coding this up and it looks messy and complicated and slow.
I can do it this way, but if someone feels like showing off his Excel
prowess and helping me out by giving me some ideas, I would appreciate
it.

thanks,
Tommy


--
TommySzalapski
------------------------------------------------------------------------
TommySzalapski's Profile:

http://www.excelforum.com/member.php...o&userid=25561
View this thread: http://www.excelforum.com/showthread...hreadid=392256





All times are GMT +1. The time now is 05:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com