LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default group (add) numbers without exceeding 168

I was trying to show that there might be an odd lot and hold it to one
decimal point. This will show the number of Whole lots of 168 you can get
and an odd lot carried to several decimal places.

Sub grp168()
lstRw = Cells(Rows.Count, 1).End(xlUp).Row
doMath = lstRw / 168
grpNumb = CDbl(doMath)
MsgBox "You can organize " & grpNumb & _
" Groups of 168 items.", , "Groups"
End Sub


"Zab" wrote:

i am receiving a compile and syntax error in this line...

grpNumb = CDbl(Format(lstRw/168, "#0.000.0")
--
Thank You, Zab


"JLGWhiz" wrote:

Assume that the numbers are in Column A and there are no empty rows.

Sub grp168()
lstRw = Cells(Rows.Count, 1).End(xlUP).Row
grpNumb = CDbl(Format(lstRw/168, "#0.000.0")
MsgBox "You can organize " & grpNumb & _
"Groups of 168 items.",, "Groups"
End Sub

I don't understand the second part of your posting.

"Zab" wrote:

hello i am triing to group these numbers below, but i do not want the total
to exceed 168. i need to know how many pieces that are 168 in length it will
take. i would imagine it will take some vba to conduct this and i am fine
with this.

23.5
23.5
30.883
30.883
30.883
30.883
37.383
37.383
43.411
43.411
47
48
49.876
50.646
50.883
50.883
50.883
50.883
50.883
50.883
50.883
50.883
55.383
55.383
59.5
90


below i have manually grouped the numbers together with their totals to the
right.
50.883 50.883 50.883 = 152.649
50.883 50.883 50.883 = 152.649
48 43.411 30.883 30.883 = 153.177
55.383 50.883 50.883 = 157.149
50.646 47 43.411 23.5 = 164.557
59.5 55.383 49.876 = 164.759
90 37.383 37.383 = 164.766

30.883 30.883 23.5 = 85.266

--
Thank You in advance, Zab

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007-digit separator ',' for numbers/currency exceeding 999, Keith Excel Discussion (Misc queries) 3 March 28th 09 02:45 PM
group (add) numbers without exceeding 168" the best possible way. Zab Excel Discussion (Misc queries) 0 January 24th 08 05:56 PM
How can I convert a group of numbers to a group of letters? CarlG Excel Worksheet Functions 9 August 18th 06 03:31 PM
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Excel Worksheet Functions 3 January 19th 06 09:52 AM
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Excel Worksheet Functions 1 January 9th 06 01:23 PM


All times are GMT +1. The time now is 04:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"