Grouped by fixed numbers

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,422
Office Version
  1. 2010
Hello,</SPAN></SPAN>

Column "B" contains the codes, in the column "C" codes are grouped by in the friction of (1 to 2187) (2188 to 4374) and so on, numbers.</SPAN></SPAN>

Example B4=100 are in the group from 1 to 2187, and the B5=3250 is in the group from 2188 to 4374 Note: to get these group frictions result I am using following formula.</SPAN></SPAN>

The Codes are from 1 to 7 digits say example 1 to 3.000.000 so far I am looking the formula the can the can give me the results in 7 digit as shown in the column "D (adding 0's and making the result in 7 digits as the result of B4 In D4 (not as C4)</SPAN></SPAN>

Example...</SPAN></SPAN>


Book1
ABCD
1
2CodesGrouped By 2187Requited Result With 7 Digits
3CodesFrom - ToFrom - To
41001 - 21870000001 - 0002187
53.2502188 - 43740002188 -0004374
69.9808749 - 109350008749 - 0010935
710.7908749 - 109350008749 - 0010935
819.87519684 - 218700019684 - 0021870
938.89937180 - 393660037180 - 0039366
1097.07696229 - 984150096229 - 0098415
1115.47815310 - 174960015310 - 0017496
1237.03834993 - 371790034993 - 0037179
13899.000898858 - 9010440898858 - 0901044
14748.341747955 - 7501410747955 - 0750141
15184.326183709 - 1858950183709 - 0185895
162001 - 21870000001 - 0002187
177.6306562 - 87480006562 - 0008748
18102.522100603 - 1027890100603 - 0102789
191.235.6891235656 - 12378421235656 - 1237842
202.176.9852176066 - 21782522176066 - 2178252
211.000.005999460 - 10016460999460 - 1001646
22867.789866053 - 8682390866053 - 0868239
2339.00037180 - 393660037180 - 0039366
2452.50052489 - 546750052489 - 0054675
Sheet1
Cell Formulas
RangeFormula
C4=INT((B4-1)/2187)*2187+1 & " - " & INT(((B4-1)/2187)+1)*2187


Thank you all</SPAN></SPAN>

Excel 2000</SPAN></SPAN>
Regards,</SPAN>
Moti</SPAN>
 
Last edited:

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
try TEXT(A1,"0000000")

replace A1 with a number or reference to a number
Hello cerfani, I can't get the result as I needed in the column "D"</SPAN></SPAN>

Thank you for your help
</SPAN></SPAN>

Kind Regards,
</SPAN>
Moti
</SPAN></SPAN>
 
Upvote 0
Try this in D4 and fill down:

Code:
=TEXT(LEFT(C4,FIND(" ",C4)-1),"0000000")&" - "&TEXT(RIGHT(C4,LEN(C4)-FIND("-",C4)),"0000000")
 
Upvote 0
Try this in D4 and fill down:

Code:
=TEXT(LEFT(C4,FIND(" ",C4)-1),"0000000")&" - "&TEXT(RIGHT(C4,LEN(C4)-FIND("-",C4)),"0000000")
Wow kweaver, it worked 100% totally solved!</SPAN></SPAN>

I appreciate your help have a great weekend.
</SPAN></SPAN>

Kind Regards,
</SPAN>
Moti
</SPAN> :)</SPAN>
 
Last edited:
Upvote 0
You could also use your original formula like
=TEXT(INT((B4-1)/2187)*2187+1,"0000000") & " - " & TEXT(INT(((B4-1)/2187)+1)*2187,"0000000")
 
Upvote 0
Solution
You could also use your original formula like
=TEXT(INT((B4-1)/2187)*2187+1,"0000000") & " - " & TEXT(INT(((B4-1)/2187)+1)*2187,"0000000")
Excellent Fluff, your formula is straight and more efficient I will go with your formula</SPAN></SPAN>

I appreciate your help have a great weekend.
</SPAN></SPAN>

Kind Regards,
</SPAN></SPAN>
Moti
</SPAN></SPAN>:-D
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,704
Messages
6,173,984
Members
452,540
Latest member
haasro02

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