Return 1 if between 0 and 4 and 2 if between 5 and 9.

serge

Well-known Member
Joined
Oct 8, 2008
Messages
1,446
Office Version
  1. 2007
Platform
  1. Windows
Need help with a formula that would return 1 if the number is between 0 and 4 and 2 if the number is between 5 and 9.

1 in column C and 2 in column D.

Thank you.

Excel Workbook
ABCDE
10-45-9
2
301
482
541
662
752
811
972
1021
11
Sheet1
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
serge,

Cell C3 formula:
=IF(AND(A3<>"",A3>=0,A3<=4),1,"")

Cell D3 formula:
=IF(AND(A3<>"",A3>=5,A3<=9),2,"")

Then copy down

Hope that helps,
~tigeravatar
 
Upvote 0
Thanks to both of you that's what I needed.
Serge.
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,233
Members
452,898
Latest member
Capolavoro009

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