ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Modify and add extra condition (https://www.excelbanter.com/excel-worksheet-functions/248621-modify-add-extra-condition.html)

gootroots

Modify and add extra condition
 
Hi,

The following formula establishes if there is a match for B158

=IF(ISNA(MATCH(B158,'formula Test'!$A:$A,0)),IF(ISNA(MATCH(B158,'formula
Test'!A:A,0)),"No Match Found",B158),B158)

I now want to modify and add an extra condition.

When a match is found in 'formula Test'!$A:$A I want to establish if the
corresponding cell in column D contains a value and return that value
instead.

For example:

B158 = €śApples€ť

€śApples€ť has been match to A364 in 'formula Test'!$A:$A

The cell in D364 'formula Test'! = €śRed Apples€ť

The formula should return €śRed Apples€ť

If cell D364 had not contained a value then nothing should be returned.




Pete_UK

Modify and add extra condition
 
Your formula actually tests the condition twice. It only needs to be:

=IF(ISNA(MATCH(B158,'formula Test'!$A:$A,0)),"No Match Found",B158)

What you want now, though, is this:

=IF(ISNA(MATCH(B158,'formula Test'!$A:$A,0)),"No Match Found",IF(INDEX
('formula Test'!$D:$D,MATCH(B158,'formula Test'!$A:$A,0))="","",INDEX
('formula Test'!$D:$D,MATCH(B158,'formula Test'!$A:$A,0))))

This will return No Match Found if there is no match and will return
an empty cell if the corresponding cell in column D is empty when a
match is found.

Hope this helps.

Pete

On Nov 17, 10:43*am, gootroots
wrote:
Hi,

The following formula establishes if there is a match for B158

=IF(ISNA(MATCH(B158,'formula Test'!$A:$A,0)),IF(ISNA(MATCH(B158,'formula
Test'!A:A,0)),"No Match Found",B158),B158)

I now want to modify and add an extra condition.

When a match is found in 'formula Test'!$A:$A *I want to establish if the
corresponding cell *in column D contains a value and return that value
instead.

For example:

B158 = “Apples”

“Apples” has been match to A364 in 'formula Test'!$A:$A

The cell in D364 'formula Test'! *= “Red Apples”

The formula should return “Red Apples”

If cell D364 had not contained a value then nothing should be returned.



Ms-Exl-Learner

Modify and add extra condition
 
Try this€¦

=IF(B158="","",IF(ISNA(VLOOKUP(B158,'formula Test'!A:D,4,0)),"No Match
Found",VLOOKUP(B158,'formula Test'!A:D,4,0)))

If this post helps, Click Yes!

--------------------
(Ms-Exl-Learner)
--------------------



"gootroots" wrote:

Hi,

The following formula establishes if there is a match for B158

=IF(ISNA(MATCH(B158,'formula Test'!$A:$A,0)),IF(ISNA(MATCH(B158,'formula
Test'!A:A,0)),"No Match Found",B158),B158)

I now want to modify and add an extra condition.

When a match is found in 'formula Test'!$A:$A I want to establish if the
corresponding cell in column D contains a value and return that value
instead.

For example:

B158 = €śApples€ť

€śApples€ť has been match to A364 in 'formula Test'!$A:$A

The cell in D364 'formula Test'! = €śRed Apples€ť

The formula should return €śRed Apples€ť

If cell D364 had not contained a value then nothing should be returned.





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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com