MATCH, IF, AND Formula Help Needed

Yosemite

New Member
Joined
Nov 16, 2018
Messages
5
Hello,

Thank you for reading my question. I am trying to create a formula but can't figure it out. This is what I'm looking for:


IF anything in Column A matches

AND of those matches, If any cell in Column B is equal to 3140, 3140L, 3141, 3141L, 3142, 3142L, 3143, 3143L, 3144, 3144L, 3145, 3145L, 3146, 3146L

THEN the result in Column C should be either 3140, 3140L, 3141, 3141L, etc.


A
B
C
51910
3140
3140
51910
4301
3140
51910
8043
3140
78047
4095
3141L
78047
3141L
3141L
78047
4252
3141L
78047
3141L
3141L
78330
4041
3144L
78330
3144L
3144L

<tbody>
</tbody>

Can anybody help with the correct formula? I'm so lost!


Thank you!
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
i dont quite follow
how does excel know what value to put into column C you say
Column C should be either 3140, 3140L, 3141, 3141L, etc.
But whats the rule to decide on the value

in the first example
5191043013140
5191080433140

<tbody>
</tbody>

column B does NOT equal 3140, 3140L, 3141, 3141L, 3142, 3142L, 3143, 3143L, 3144, 3144L, 3145, 3145L, 3146, 3146L
so why is there a result in C

etc - does not help , as i dont know what that may mean to you
 
Upvote 0
Like in my example, A2, A3 and A4 all have 51910 so that would be the match.
The Formula in column C would result in 3140 for C2, C3, and C4
 
Upvote 0
Since A2 matches A3 and A4, then the C2, C3 and C4 would all be 3140 because one of the Matched Cells in Column B is 3140.

A
BC
51910
31403140
51910
43013140
51910
80433140

<tbody>
</tbody>

Sorry, the etc was referencing 3140, 3140L, 3141, 3141L, 3142, 3142L, 3143, 3143L, 3144, 3144L, 3145, 3145L, 3146, 3146L
 
Upvote 0
why is column C 3140 and not one of the other choices
3140, 3140L, 3141, 3141L, etc.
which I assume ETC means its only these choices
3140, 3140L, 3141, 3141L, 3142, 3142L, 3143, 3143L, 3144, 3144L, 3145, 3145L, 3146, 3146L

 
Upvote 0
why is column C 3140 and not one of the other choices
3140, 3140L, 3141, 3141L, etc.
which I assume ETC means its only these choices
3140, 3140L, 3141, 3141L, 3142, 3142L, 3143, 3143L, 3144, 3144L, 3145, 3145L, 3146, 3146L


In my example, Column C is where the Formula should go. The result is 3140 because the three rows in Column A are 51910 and therefore all match.

There will be several random numbers in column B. But if there is a 3140, 3140L, 3141, 3141L, 3142, 3142L, 3143, 3143L, 3144, 3144L, 3145, 3145L, 3146, or 3146L
in column B then I want 3140, 3140L, 3141, 3141L, 3142, 3142L, 3143, 3143L, 3144, 3144L, 3145, 3145L, 3146, or 3146L to go to all the rows in C that have matching
cells in A.

I hope this makes sense. Thank you for your patience with me.
 
Upvote 0
How about:


ABCDEF
15191031403140List
251910430131403140
351910804331403140L
47804740953141L3141
5780473141L3141L3141L
67804742523141L3142
7780473141L3141L3142L
87833040413144L3143
9783303144L3144L3143L
103144
113144L
123145
133145L
143146
153146L

<tbody>
</tbody>
Sheet5

Worksheet Formulas
CellFormula
C1=IFERROR(LOOKUP(2,1/COUNTIFS($A$1:$A$20,A1,$B$1:$B$20,$E$2:$E$15),$E$2:$E$15),B1)

<tbody>
</tbody>

<tbody>
</tbody>


I put the list of values you care about in E2:E15. You can hide the list if you want, or put it on another sheet, but doing it this way makes it easier to update if needed.
 
Last edited:
Upvote 0
Wow!! That is exactly what I needed! Thank you so much!! You just saved me hours of extra work every month. I appreciate the help!
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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