If one cell equals "Value", then the cell the formula is in equals "figure", for multiple value options

Outlook12

New Member
Joined
Apr 8, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi, I wanted to craft a formulae that would allow me to do the following:

If A1 = "black", then the cell would equal 20, If A1 = "green", then the cell would equal 50, If cell A1 = "blue", then cell would equal 15, etc.

Thank you,
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Welcome to the MrExcel board!

You could do it like I have in column B but more common and easier to edit or maintain is to have a lookup list and use one of the available lookup functions as I have done in column C.

24 04 08.xlsm
ABCDEF
1green5050black20
2black2020green50
3blue15
4
5
Lookup 3
Cell Formulas
RangeFormula
B1:B2B1=IF(A1="black",20,IF(A1="green",50,IF(A1="blue",15,"")))
C1:C2C1=XLOOKUP(A1,E$1:E$10,F$1:F$10)
 
Upvote 0
Welcome to the MrExcel board!

You could do it like I have in column B but more common and easier to edit or maintain is to have a lookup list and use one of the available lookup functions as I have done in column C.

24 04 08.xlsm
ABCDEF
1green5050black20
2black2020green50
3blue15
4
5
Lookup 3
Cell Formulas
RangeFormula
B1:B2B1=IF(A1="black",20,IF(A1="green",50,IF(A1="blue",15,"")))
C1:C2C1=XLOOKUP(A1,E$1:E$10,F$1:F$10)

Thank you so much!
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,215,330
Messages
6,124,308
Members
449,151
Latest member
JOOJ

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