Nested Wildcard If with variable concatinate

beldorian

New Member
Joined
Aug 16, 2011
Messages
3
Sorry if this has been addressed previously, but I have tried to search on everything I can think of before posting this:

:confused: In Excel 2007, I have the following formula in column AG:
=IF(AF2>AE2,"Standard - Company1 automated quote is higher than Company2 rate",IF(AF2<=(AE2-(AE2*0.2)),"Premier - Company1 is "&TEXT(AH2,"#.##%")&" less than Company2 rate","High - Company1 is "&TEXT(AH2,"#.##%")&" less than Company2 rate"))

In column N of the same sheet, I am trying to classify A, B, C based on Premier, High, or Standard. I have tried what I can think of and what I have found so far including LEN(), but cannot seem to get the correct result using the following formulas (these are just a couple of the many I have tried):

=IF(LEN(AG2)=45,"A",IF(LEN(AG2)=42,"B","C"))
=IF(AG2="Premier*","A",IF(AG2="High*","B","C"))

It can't be this hard... can it? I appreciate any help you can give.

-Thanks!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi
Welcome to the board

I'm not sure exactly of what you need, but maybe:

=IF(ISNUMBER(SEARCH("premier",AG2)),"A",IF(ISNUMBER(SEARCH("high",AG2)),"B","C"))
 
Upvote 0
How about:
=IF(LEFT(AG2,7)="Premier","A",IF(LEFT(AG2,4)="High","B","C"))
?
 
Upvote 0
Hi
Welcome to the board

I'm not sure exactly of what you need, but maybe:

=IF(ISNUMBER(SEARCH("premier",AG2)),"A",IF(ISNUMBER(SEARCH("high",AG2)),"B","C"))

Thanks for your reply, I really appreciate it :) This one works, except it still returns B for what should be the C - for some reason it never gets to the last false value.
 
Upvote 0
How about:
=IF(LEFT(AG2,7)="Premier","A",IF(LEFT(AG2,4)="High","B","C"))
?

Glenn - That did it!!! Thank you so much... *phew* I don't know why I couldn't stretch my brain to think of that solution, but I really REALLY appreciate that you could - Thanks again!
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,176
Members
452,893
Latest member
denay

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