Function for changing different sets of values to specific values (categorization)

BoloRen

New Member
Joined
Dec 17, 2020
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
Hey everyone. I need some help, please.

We have two tables, but let's just look at one cell in each table: A1 and D1.

A1 can only be 0, 1, 2, 3, 4, 5, or 6, and I want D1 to display a specific value depending on the input value in A1.

Specifically, I want D1 to function like this:
If A1 is 0, 1, 2 or 3, D1 should be 0.
If A1 is 4, D1 should be 1.
If A1 is 5, D1 should be 2.
If A1 is 6, D1 should be 3.

I want all of these conditions to be embedded in one cell (D1).

Here is my attempt:

=IF(A1="0","0",IF(A1="1","0",IF(A1="2","0",IF(A1="3","0",IF(A1="4","1",IF(A1="5","2",IF(A1="6","3")))))))

There seems to be something wrong with this formula, however. No matter what value is entered into A1, D1 will always return "FALSE".

Any suggestions?
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,216,952
Messages
6,133,694
Members
449,826
Latest member
henry147

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