If this then that equals

Gazman1976

New Member
Joined
Nov 20, 2020
Messages
2
Platform
  1. MacOS
Hi, can anybody help me with this formula that i can't work out please?

i have a drop down box in one column with 5 different sizes ie Extra Small, Small, Medium, Large and Extra Large and next to that l would like a number value to appear when a certain drop down is selected.

Ie

Extra Small would equal 32

Medium would equal 56

Extra Large equal 100

Any help with this would be great as l can't figure this out.

Thanks in advance
1605931341789.png

1605931373519.png
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Maybe this, but you will have to expand it for the other "Sizes", as you haven't provided the numbers for them
Excel Formula:
=LOOKUP(G2,{"Extra Small","Medium","Extra Large"},{32,56,100})
 
Upvote 0
Maybe this, but you will have to expand it for the other "Sizes", as you haven't provided the numbers for them
Excel Formula:
=LOOKUP(G2,{"Extra Small","Medium","Extra Large"},{32,56,100})
Michael, did you try that formula with Extra Large in G2?

It would need to be
Excel Formula:
=LOOKUP(G2,{"Extra Large","Extra Small","Medium"},{100,32,56})

However, it appears that there may actually be a lookup table in B45:C49 in which case I would use
Excel Formula:
=VLOOKUP(G2,$B$45:$C$49,2,0)
 
Upvote 0
Maybe this, but you will have to expand it for the other "Sizes", as you haven't provided the numbers for them
Excel Formula:
=LOOKUP(G2,{"Extra Small","Medium","Extra Large"},{32,56,100})
This worked thank you. Just need some advice on how to remove the #N/A from column H after l drag down the formula.
 

Attachments

  • #N:A Picture.png
    #N:A Picture.png
    187.2 KB · Views: 4
Upvote 0
Change the formula to
Excel Formula:
=IF(G2="","",LOOKUP(G2,{"Extra Large","Extra Small","Medium",""},{100,32,56,""}))
 
Upvote 0
This worked thank you.
As I mentioned before, it did not work if the lookup value was "Extra large" (return is #N/A) as the values in the first array must be in ascending order for it to work. You will note that in post #5 Michael has now rearranged those values in the first array per my suggestion in post #3.

If your #N/A values are coming because the lookup cell is empty, then you could also use this.
Excel Formula:
=IFNA(LOOKUP(G2,{"Extra Large","Extra Small","Medium"},{100,32,56}),"")
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,541
Members
449,089
Latest member
davidcom

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