Insert a certain value if a value is meet.

g3org

Board Regular
Joined
Jul 25, 2021
Messages
69
Office Version
  1. 365
Platform
  1. Windows
Hello everyone again and thank you for all the support.
In one cell i will have a value and i would like to have another value in other cell based of the first one.

In A1 will be a number from 0 to 30 and i want in B1 to have like this:

If is 0 in A1 the value should be 300 in B1
If is 1 in A1 the value should be 200 in B1
If is 2 in A1 the value should be 150 in B1
If is 3 in A1 the value should be 100 in B1
And all values over 3 in A1 to be 0 in B1
Can be possible to be done with only one formula?

Thanks in advance.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
How about
Excel Formula:
=SWITCH(A1,0,300,1,200,2,150,3,100,0)
 
Upvote 0
Hello there and thank you for your quick respond. Thank you, it is working, as always. I did realize that it would be perfect in another cells value will be included like bellow:
If cell C1 is greater or equal with 20 than apply the formula above. Do you think that is possible?

Thank you
 
Upvote 0
Maybe
Excel Formula:
=IF(C2>=20,SWITCH(A1,0,300,1,200,2,150,3,100,0),"")
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,213,530
Messages
6,114,162
Members
448,554
Latest member
Gleisner2

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