Convert range of numbers to another number

Yamasaki450

Board Regular
Joined
Oct 22, 2021
Messages
71
Office Version
  1. 2021
Platform
  1. Windows
Hello everyone. I need some help again :)

I need to covert range of numbers in to another number...
In column E i would like to convert all numbers from 1 to 5 in to "0" and numbers from 6 to 10 in to "1" So numbers 1,2,3,4,5 are displayed as 0 and numbers 6,7,8,9,10 are displayed as 1

Anyone know formula for this? So i can just drag it down... Or select whole column and put it in conditional formatting function.

See picture below.

Thanks guys.
 

Attachments

  • Clipboard02.jpg
    Clipboard02.jpg
    114.7 KB · Views: 15

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Assuming you only have numbers from 1 - 10 inclusive:
Book1
EFGHIJKLMNOPQR
130
210
391
410
540
640
750
871
930
1030
1120
1271
1381
1471
1561
1640
Sheet1
Cell Formulas
RangeFormula
R1:R16R1=IF(E1<6,0,1)
 
Upvote 0
Thanks. It works for numbers up to 10 yes. But numbers go higher than 10... What i actually need is to display numbers 1,2,3,4,5 as "0" 6,7,8,9,10 as "1" 11,12,13,14,15 as "3" 16,19,25,30,33 as "4" and so on...

Sorry i should mention this in first place. I just need an example of formula and i will continue myself.
 
Upvote 0
16,19,25,30,33 as "4"
I don't get that logic - I would have thought 16-20 inclusive would have been 3 based on what you wanted for 1-5 and 6-10. Assuming that was a typo on your part, see if this gives you what you're after:
Book1
EFGHIJKLMNOPQR
130
210
391
410
540
640
750
871
930
1030
1120
1271
1381
1471
1561
1640
17112
18254
19336
20295
21163
22173
23214
Sheet1
Cell Formulas
RangeFormula
R1:R23R1=CEILING(E1-5,5)/5
 
Upvote 1
Solution
Oh yes big typo. I need some sleep heh :) What you gave me is exactly what i need and it works like magic! I thought formula will be more complicated but you made it simple...

Thanks a lot for your time :)

Have a nice day.
 
Upvote 0
FWIW, here's another one you could also try:
Excel Formula:
=INT((E33-1)/5)
 
Upvote 1

Forum statistics

Threads
1,223,884
Messages
6,175,174
Members
452,615
Latest member
bogeys2birdies

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