Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Phil
 
Posts: n/a
Default cross referencing

I am trying to find a formula that looks at a range of cells, a2:b11, and if
a cell in the range has a value Phil and its adjacent cell in the other
column
has a value Tony then AA1=1, if no adjacent cells match the criteria AA1
=0. The names can be in either column.

For instance...

A B
Phil Tony would give AA1 value 1
Tony Phil would also give AA1 value 1
xxx yyy would give AA1 value 0

Thanks





  #2   Report Post  
Roger Govier
 
Posts: n/a
Default

Hi Phil
In cell AA1
=AND(A1="phil",B1="Tony")+AND(A1="Tony",B1="Phil") *1

--
Regards

Roger Govier


"Phil" wrote in message
. uk...
I am trying to find a formula that looks at a range of cells, a2:b11, and
if
a cell in the range has a value Phil and its adjacent cell in the other
column
has a value Tony then AA1=1, if no adjacent cells match the criteria AA1
=0. The names can be in either column.

For instance...

A B
Phil Tony would give AA1 value 1
Tony Phil would also give AA1 value 1
xxx yyy would give AA1 value 0

Thanks







  #3   Report Post  
Phil
 
Posts: n/a
Default

Thanks, that works if the values Phil and Tony are in A1 or B1 but they
could be anywhere from A2 : A11 or B2 : B11
"Roger Govier" wrote in message
...
Hi Phil
In cell AA1
=AND(A1="phil",B1="Tony")+AND(A1="Tony",B1="Phil") *1

--
Regards

Roger Govier


"Phil" wrote in message
. uk...
I am trying to find a formula that looks at a range of cells, a2:b11, and
if
a cell in the range has a value Phil and its adjacent cell in the other
column
has a value Tony then AA1=1, if no adjacent cells match the criteria

AA1
=0. The names can be in either column.

For instance...

A B
Phil Tony would give AA1 value 1
Tony Phil would also give AA1 value 1
xxx yyy would give AA1 value 0

Thanks









  #4   Report Post  
RagDyeR
 
Posts: n/a
Default

What happens if you have *multiple* occurrences of "Tony" and "Phil"?

See if this works for you.

Will count *all* occurrences of "Tony" and "Phil" being on the same line
(row):

=SUMPRODUCT((A2:B11={"Tony","Phil"})*(A2:B11={"Phi l","Tony"}))

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"Phil" wrote in message
. uk...
Thanks, that works if the values Phil and Tony are in A1 or B1 but they
could be anywhere from A2 : A11 or B2 : B11
"Roger Govier" wrote in message
...
Hi Phil
In cell AA1
=AND(A1="phil",B1="Tony")+AND(A1="Tony",B1="Phil") *1

--
Regards

Roger Govier


"Phil" wrote in message
. uk...
I am trying to find a formula that looks at a range of cells, a2:b11, and
if
a cell in the range has a value Phil and its adjacent cell in the other
column
has a value Tony then AA1=1, if no adjacent cells match the criteria

AA1
=0. The names can be in either column.

For instance...

A B
Phil Tony would give AA1 value 1
Tony Phil would also give AA1 value 1
xxx yyy would give AA1 value 0

Thanks










  #5   Report Post  
Roger Govier
 
Posts: n/a
Default

Hi Phil

The following array formula works for me. To enter an array formula, press
Crontrol+Shift+Enter after the final ).
Do not enter the { } brackets, Excel will do this for you.
=IF(SUM((A1:A11="Phil")*(B1:B11="Tony")*1)+SUM((A1 :A11="Tony")*(B1:B11="Phil")*1),1,0)

--
Regards

Roger Govier


"Phil" wrote in message
. uk...
Thanks, that works if the values Phil and Tony are in A1 or B1 but they
could be anywhere from A2 : A11 or B2 : B11
"Roger Govier" wrote in message
...
Hi Phil
In cell AA1
=AND(A1="phil",B1="Tony")+AND(A1="Tony",B1="Phil") *1

--
Regards

Roger Govier


"Phil" wrote in message
. uk...
I am trying to find a formula that looks at a range of cells, a2:b11,
and
if
a cell in the range has a value Phil and its adjacent cell in the other
column
has a value Tony then AA1=1, if no adjacent cells match the criteria

AA1
=0. The names can be in either column.

For instance...

A B
Phil Tony would give AA1 value 1
Tony Phil would also give AA1 value 1
xxx yyy would give AA1 value 0

Thanks













  #6   Report Post  
Phil
 
Posts: n/a
Default

Tony and Phil will only appear once
"RagDyeR" wrote in message
...
What happens if you have *multiple* occurrences of "Tony" and "Phil"?

See if this works for you.

Will count *all* occurrences of "Tony" and "Phil" being on the same line
(row):

=SUMPRODUCT((A2:B11={"Tony","Phil"})*(A2:B11={"Phi l","Tony"}))

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"Phil" wrote in message
. uk...
Thanks, that works if the values Phil and Tony are in A1 or B1 but they
could be anywhere from A2 : A11 or B2 : B11
"Roger Govier" wrote in message
...
Hi Phil
In cell AA1
=AND(A1="phil",B1="Tony")+AND(A1="Tony",B1="Phil") *1

--
Regards

Roger Govier


"Phil" wrote in message
. uk...
I am trying to find a formula that looks at a range of cells, a2:b11,

and
if
a cell in the range has a value Phil and its adjacent cell in the

other
column
has a value Tony then AA1=1, if no adjacent cells match the criteria

AA1
=0. The names can be in either column.

For instance...

A B
Phil Tony would give AA1 value 1
Tony Phil would also give AA1 value 1
xxx yyy would give AA1 value 0

Thanks












  #7   Report Post  
Phil
 
Posts: n/a
Default

Thanks, that works OK. It a bit different to one i had , but stupidly lost
after a system crash, though. That , as far as i remember looked something
like....
=if(A2:B11=("Phil:Tony"),1,if(A2:b11=("Tony:Phil") ,1,0)
I know thats not right cos it dont work.

Thank aagain
"Roger Govier" wrote in message
...
Hi Phil

The following array formula works for me. To enter an array formula, press
Crontrol+Shift+Enter after the final ).
Do not enter the { } brackets, Excel will do this for you.

=IF(SUM((A1:A11="Phil")*(B1:B11="Tony")*1)+SUM((A1 :A11="Tony")*(B1:B11="Phil
")*1),1,0)

--
Regards

Roger Govier


"Phil" wrote in message
. uk...
Thanks, that works if the values Phil and Tony are in A1 or B1 but they
could be anywhere from A2 : A11 or B2 : B11
"Roger Govier" wrote in message
...
Hi Phil
In cell AA1
=AND(A1="phil",B1="Tony")+AND(A1="Tony",B1="Phil") *1

--
Regards

Roger Govier


"Phil" wrote in message
. uk...
I am trying to find a formula that looks at a range of cells, a2:b11,
and
if
a cell in the range has a value Phil and its adjacent cell in the

other
column
has a value Tony then AA1=1, if no adjacent cells match the criteria

AA1
=0. The names can be in either column.

For instance...

A B
Phil Tony would give AA1 value 1
Tony Phil would also give AA1 value 1
xxx yyy would give AA1 value 0

Thanks













Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross workbook referencing based on cell input Neil Mitchell-Goodson Excel Worksheet Functions 1 June 17th 05 05:32 PM
cross hatching and pie chart Cenk Ursavas via OfficeKB.com Charts and Charting in Excel 3 May 7th 05 01:04 AM
How do I turn off relative cell referencing in excel? Glenn New Users to Excel 1 April 13th 05 03:06 AM
Relative Indirect Formula Referencing? Damian Excel Worksheet Functions 1 January 7th 05 04:16 AM
How do I find a cross reference value Jo Davis Excel Discussion (Misc queries) 2 November 30th 04 12:56 PM


All times are GMT +1. The time now is 05:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"