IFAND formula

Daithi

New Member
Joined
Feb 28, 2014
Messages
15
Apologies if this has been covered. I looked at many posts before writing.

I have 2 worksheets, A & B.

I need my formula to look at cell A2 in Sheet B and compare it to Cell A2 in Sheet A. If they match AND the value in sheet A cell B2 is Individual, I want to return the value in Sheet A cell C2.

This is as far as I got.

=IF(AND(A2=SheetA!A2:$A$1999),SheetA!$B$2:$B$2004="Individual",SheetA!$F$2:$F$1999)

Any help gratefully received.

David
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
What you described would be something like this.
I need my formula to look at cell A2 in Sheet B and compare it to Cell A2 in Sheet A. If they match AND the value in sheet A cell B2 is Individual, I want to return the value in Sheet A cell C2.

Excel Workbook
ABCD
1
2testindividualReturn Value
3Return Value
4
5
SheetA
Excel Workbook
AB
1
2test
3
SheetB




However looking at your formula it's unclear.
Where does F2:F1999 come from if you want to return value in C2?
Are you trying to match A2 to a range of values A2:A1999 or just A2 to A2?
 
Upvote 0
Hi

Thanks for the quick reply. Yes, you are correct. My spreadsheet does have 1,999 rows. My plan was to fill the formula down. I notice that I wasn't clear enough in my post.

My formula would be in Sheet B, Cell C2.
It needs to look at Cell A2 in Sheet B and compare this value to Cell A2 in Sheet A.
If they match AND the value in Sheet A Cell B2 is Individual, I want to return the value in Sheet A Cell F2.

Appreciate your patience
 
Upvote 0
Copy formula down as needed.

Excel Workbook
ABC
1
268Test1
331
468
536
632
757
893Test7
935
1054
1196Test10
1243
1363Test12
SheetB
Excel Workbook
AB
1
268individual
331Test
468Test
545individual
632Test
757Test
893individual
935Test
1054
1196individual
1243Test
1363individual
SheetA
 
Upvote 0
Brilliant!!!! Thank you so very much.


Copy formula down as needed.

SheetB

ABC
1
268 Test1
331
468
536
632
757
893 Test7
935
1054
1196 Test10
1243
1363 Test12

<colgroup><col style="width:30px; "><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
C2=IF(AND(A2=SheetA!A2,SheetA!B2="individual"),SheetA!F2,"")

<tbody>
</tbody>

<tbody>
</tbody>


SheetA

AB
1
268individual
331Test
468Test
545individual
632Test
757Test
893individual
935Test
1054
1196individual
1243Test
1363individual

<colgroup><col style="width:30px; "><col style="width:64px;"><col style="width:99px;"></colgroup><tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Upvote 0
Your solution worked perfectly when the values in Sheet B, Column A are unique. My worksheet has the same value repeated multiple times. I wish I could upload even a screen shot of what I'm doing.
 
Upvote 0
One way to post a small sample is to put a boarder around the cells and then use copy / paste to insert into the forum.
What do you want to see when items repeat?
 
Upvote 0
Sheet A
ExampleIDName FormatTitleFirst NameMiddleLast NameSuffix
Example0001BusinessMrJohnJonesOBE
Example0002BusinessJRobson
Example0003Family
Example0004IndividualDrJohnTThompson
Example0005IndividualMr & MrsJohn & MaryBlakely
Example0006IndividualProf.TomMSmith

<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>

Sheet B

ExampleIDName FormatLast Name
Example0001Business
Example0002Business
Example0003Family
Example0004IndividualThompson
Example0005IndividualBlakely
Example0006IndividualSmith
Example0006Individual
Example0006Individual

<colgroup><col><col><col></colgroup><tbody>
</tbody>

In this example Smith would be returned/repeated

One way to post a small sample is to put a boarder around the cells and then use copy / paste to insert into the forum.
What do you want to see when items repeat?
 
Upvote 0
Try:
This is an array formula and must be entered with CTRL-SHIFT-ENTER.
Drag formula down as needed.

Excel Workbook
ABC
1ExampleIDName FormatLast Name
2Example0001Business 
3Example0002Business 
4Example0003Family 
5Example0004IndividualThompson
6Example0005IndividualBlakely
7Example0006IndividualSmith
8Example0006IndividualSmith
9Example0006IndividualSmith
SheetB
Excel Workbook
ABCDEFG
1ExampleIDName FormatTitleFirst NameMiddleLast NameSuffix
2Example0001BusinessMrJohnJonesOBE
3Example0002BusinessJRobson
4Example0003Family
5Example0004IndividualDrJohnTThompson
6Example0005IndividualMr & MrsJohn & MaryBlakely
7Example0006IndividualProf.TomMSmith
SheetA
 
Upvote 0
YES!!!!

Thank you so very much :)

AhoyNYES C;5091462 said:
Try:
This is an array formula and must be entered with CTRL-SHIFT-ENTER.
Drag formula down as needed.

SheetB

ABC
1ExampleIDName FormatLast Name
2Example0001Business
3Example0002Business
4Example0003Family
5Example0004IndividualThompson
6Example0005IndividualBlakely
7Example0006IndividualSmith
8Example0006IndividualSmith
9Example0006IndividualSmith

<colgroup><col style="width:30px; "><col style="width:115px;"><col style="width:108px;"><col style="width:93px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
C2{=IFERROR(INDEX(SheetA!$F$2:$F$7,MATCH(SheetB!$A2&"/"&"Individual",SheetA!$A$2:$A$7&"/"&SheetA!$B$2:$B$7,0)),"")}
C3{=IFERROR(INDEX(SheetA!$F$2:$F$7,MATCH(SheetB!$A3&"/"&"Individual",SheetA!$A$2:$A$7&"/"&SheetA!$B$2:$B$7,0)),"")}
C4{=IFERROR(INDEX(SheetA!$F$2:$F$7,MATCH(SheetB!$A4&"/"&"Individual",SheetA!$A$2:$A$7&"/"&SheetA!$B$2:$B$7,0)),"")}
C5{=IFERROR(INDEX(SheetA!$F$2:$F$7,MATCH(SheetB!$A5&"/"&"Individual",SheetA!$A$2:$A$7&"/"&SheetA!$B$2:$B$7,0)),"")}
C6{=IFERROR(INDEX(SheetA!$F$2:$F$7,MATCH(SheetB!$A6&"/"&"Individual",SheetA!$A$2:$A$7&"/"&SheetA!$B$2:$B$7,0)),"")}
C7{=IFERROR(INDEX(SheetA!$F$2:$F$7,MATCH(SheetB!$A7&"/"&"Individual",SheetA!$A$2:$A$7&"/"&SheetA!$B$2:$B$7,0)),"")}
C8{=IFERROR(INDEX(SheetA!$F$2:$F$7,MATCH(SheetB!$A8&"/"&"Individual",SheetA!$A$2:$A$7&"/"&SheetA!$B$2:$B$7,0)),"")}
C9{=IFERROR(INDEX(SheetA!$F$2:$F$7,MATCH(SheetB!$A9&"/"&"Individual",SheetA!$A$2:$A$7&"/"&SheetA!$B$2:$B$7,0)),"")}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>


SheetA

ABCDEFG
1ExampleIDName FormatTitleFirst NameMiddleLast NameSuffix
2Example0001BusinessMrJohn JonesOBE
3Example0002Business J Robson
4Example0003Family
5Example0004IndividualDrJohnTThompson
6Example0005IndividualMr & MrsJohn & Mary Blakely
7Example0006IndividualProf.TomMSmith

<colgroup><col style="width:30px; "><col style="width:110px;"><col style="width:105px;"><col style="width:74px;"><col style="width:93px;"><col style="width:51px;"><col style="width:85px;"><col style="width:43px;"></colgroup><tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Upvote 0

Forum statistics

Threads
1,214,415
Messages
6,119,375
Members
448,888
Latest member
Arle8907

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