IF/Then but the answer be another cell if true???

Jaesifur

New Member
Joined
Mar 31, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hey, I'm new to Excel so please bear with me and someone please for the love of both God and my job help me out.

1680321276695.png


Okay so I have two columns, A and C, which both have items in them. I'm wanting a formula in column B that can search A to find if there are any matches to C and if there are then to have the value of B equal to D.

That was a lot and I'm bad at explaining so let's try this.

I know that an =IF(A1=C1, D1, "No") will put the value of D, 3, into the B column. But my error is that the items in column A and column C aren't always in the same row. Like if I tried to do that for the Brown Tshirt then the result for this formula would be No because the two are in different rows. Is there a formula that would just go through all of C to find if there are any matches with A and if there are, regardless of rows, then the result would be the corresponding D value (which is associated with C).

I know this is super all over the place and probably really poorly asked, please be gentle with my ignorance.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Assuming row 3 is your first row of data. Column B could look like this:

=IFERROR(VLOOKUP(A3,$C$3:$D$11,2,FALSE),"No")

where A3 is the term you are looking up in column A and $C$3:$D$11 encompasses the entirety of your data set in columns C & D.
 
Upvote 1
Another option
Excel Formula:
=XLOOKUP(A1,$C$1:$C$10,$D$1:$D$10,"No")
 
Upvote 1
Solution
Assuming row 3 is your first row of data. Column B could look like this:

=IFERROR(VLOOKUP(A3,$C$3:$D$11,2,FALSE),"No")

where A3 is the term you are looking up in column A and $C$3:$D$11 encompasses the entirety of your data set in columns C & D.

Thank you so much!
 
Upvote 0
Another option
Excel Formula:
=XLOOKUP(A1,$C$1:$C$10,$D$1:$D$10,"No")

You are both so amazing 🥲 They both worked and fixed my problem. Seriously, 3000000/10 the MVPs for my sanity.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 1

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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