compare a cell to a column and return a value from a third cell

clivebillowes

New Member
Joined
Jul 5, 2019
Messages
8
ABCDEFGHIJ
red
20​
clive
40​
if number in "I"="40"(b3)then return "blue" (A3) to this cell
green
30​
jan
20​
if number in "I"="20"(b1)then return "red" (A1) to this cell
blue
40​
paul
50​
black
50​
peter
30​
white
60​
pat
20​
pink
70​
colin
60​
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Book1
ABHIJ
1red20clive40blue
2green30jan20red
3blue40paul50black
4black50peter30green
5white60pat20red
6pink70colin60white
Sheet5
Cell Formulas
RangeFormula
J1:J6J1=INDEX($A$1:$A$6,MATCH(I1,$B$1:$B$6,0))
 
Upvote 0
=INDEX($A$1:$A$6,MATCH(I1,$B$1:$B$6,0))
Thank you.
I see it does not work on numbers with decimals, but I have used roundup to resolve.
I also need to do the same with rows looking at a value in a cell comparing with values in k22 TO T23, returning the value in k1 to k15
I used;
=INDEX($K$22:$T$23,MATCH(Q29,$K$1:$T$1,0))
but it returns #NA error
Book1
ABHIJ
1red20clive40blue
2green30jan20red
3blue40paul50black
4black50peter30green
5white60pat20red
6pink70colin60white
Sheet5
Cell Formulas
RangeFormula
J1:J6J1=INDEX($A$1:$A$6,MATCH(I1,$B$1:$B$6,0))
 
Upvote 0
1) Which Excel version are you using?
2) The provided formula only works for 1-dimension lookup.
3) Can you provide a more representative sample of your data? The roundup can perhaps be avoided.
 
Upvote 0
1) Which Excel version are you using?
2) The provided formula only works for 1-dimension lookup.
3) Can you provide a more representative sample of your data? The roundup can perhaps be avoided.
latest office 365 no version under help
after sending my reply I tried with decimal number again and it worked not sure what changed
I cant find a way to attach the spread sheet L2XBB is giving error
I had to screenshot to show the spreadsheet
only the formula in R29 is a problem now
Data is collected from various different sheets
 

Attachments

  • Picture1.png
    Picture1.png
    255.6 KB · Views: 13
Upvote 0
Try:
Excel Formula:
=TOCOL(IF(Q29=$K$22:$T$23,$K$1:$T$1,NA()),3)

PS: You should update your current Excel version in the Account Details for the best solution.
 
Upvote 0
Solution

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

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