If result from a formula contains a character, then...

David Montoya

New Member
Joined
Apr 25, 2018
Messages
49
Dear,

I have the following issue, and looking for possible assistance.

The formula I currently have is broken into three pieces:

  1. It looks at cell A4 if empty, otherwise to process the second part...
  2. It looks if a separate table column E:E contents, and compare with a concatenation of active workbook cells D4 and G4, if the result is other than ">0", it continuous with step 3, otherwise, it stops any further process and leaving the target cell empty. If the result is =0, then the formula...
  3. It looks if the content of the active workbook cells D4 appears on a separate table, giving the found information if available, otherwise leaving the target cell empty. At this step, if it finds the target, it gives back any results from "A", "A+", or "A*"

It has been working perfect; however, I need to introduce a new condition; the options on numeral 3 above are changing to "A", "A+", "A*", "C A", "C A+", or "C A*"
Now if the 2nd step above stops the process, I need to look into the new options, and if the result contains a "C" regardless of the combination, I need to give a final result as "C" even if the separate table column E:E, and a concatenation of active workbook cells D4 and G4 the result is other than ">0", which normally provide me an empty cell result.

The following formula is in cell AM4:

Code:
=IF(A4="","",IF(COUNTIF('SPI by HTS'!E:E,"*"&'Master Query'!D4&'Master Query'!G4&"*")>0,"",IFERROR(VLOOKUP(D4,'SPI by HTS'!A:B,2,0),"")))

I have tried to first work the new condition by itself; it works, but it gives me a "FALSE" result, and the desired is to leave the target cell blank:

Code:
=IF($A4="","",IFERROR(IF(VLOOKUP(D4,'SPI by HTS'!A:B,2,0)="C A*","C",IF(VLOOKUP(D4,'SPI by HTS'!A:B,2,0)="C A","C",IF(VLOOKUP(D4,'SPI by HTS'!A:B,2,0)="C A+","C"))),""))

After combining the previous formula with the new condition; still giving me a "FALSE" result, and the desired is to leave the target cell blank if the conditions are not within "A", "A+", "A*", or "C" for any other combination:

Code:
=IF(A4="","",IFERROR(IF(VLOOKUP(D4,'SPI by HTS'!A:B,2,0)="C A*","C",IF(VLOOKUP(D4,'SPI by HTS'!A:B,2,0)="C A","C",IF(VLOOKUP(D4,'SPI by HTS'!A:B,2,0)="C A+","C"))),IF(COUNTIF('SPI by HTS'!E:E,"*"&'Master Query'!D4&'Master Query'!G4&"*")>0,"",IFERROR(VLOOKUP(D4,'SPI by HTS'!A:B,2,0),""))))

Thanks in advance for any assistance you can provide.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
I can't quite get your formula, but there is one place you have a missing piece.

Firstly ... I like to lay out any formula that's not "simple" with new lines [& indenting, which won't show in the post below for some reason] so I can see the structure a little clearer. Your second formula looks like ..

=IF($A4="","",
IFERROR(
IF( VLOOKUP(D4,'SPI by HTS'!A:B,2,0) = "C A*", "C",
IF( VLOOKUP(D4,'SPI by HTS'!A:B,2,0) = "C A","C",
IF( VLOOKUP(D4,'SPI by HTS'!A:B,2,0) = "C A+","C"
))),
""))

The last "IF" is missing it's 'else' formula/value so if the result of the previous IF's are false, then you will see "FALSE" as your answer.

You may be able to see where things are wrong in the construct from there.
 
Last edited:
Upvote 0
Ludwig,

Thank you very much! Your suggestion did the trick. Now, my complete working formula is:

Code:
=IF(A4="","",IFERROR(IF(VLOOKUP(D4,'SPI by HTS'!A:B,2,0)="C A*","C",IF(VLOOKUP(D4,'SPI by HTS'!A:B,2,0)="C A","C",IF(VLOOKUP(D4,'SPI by HTS'!A:B,2,0)="C A+","C",IF(COUNTIF('SPI by HTS'!E:E,"*"&'Master Query'!D4&'Master Query'!G4&"*")>0,"",IFERROR(VLOOKUP(D4,'SPI by HTS'!A:A,0)[B],""[/B])))))[B],""[/B]))

Best regards!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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