Help with IF AND formula

MsMonarch

New Member
Joined
Nov 17, 2016
Messages
3
Hello

I have a list of suppliers and sales reps that are assigned by Alphabet. For example; any supplier that begins with letters A-C are assigned to JAMIE, in addition to that any suppliers that begin with letters D-F are assigned to DONNA and suppliers that begin with letters G-I are assigned to JUSTIN and so on and so forth. A spreadsheet is provided daily with new suppliers added, I don't want to have to 'assign' each supplier manually because I pull this information into a pivot table by Sales Rep via a Macro.

I can figure out the first logic but can't include the rest in the same formula. Here is my formula:
=IF(LEFT(A3,1) = "A", B3,"NA") This formula works great for the first line but doesn't work if I try and do a range of alpha....like this:
=IF(LEFT(A4,1) = "A""B""C""D""E""F""G""H""I", B4,"NA") or like this: =IF(LEFT(A4,1) = "A-I", B4,"NA")

I have a table set up (as shown below) with alpha assignment

suppliers that begin with:REP
AJAMIE
BJAMIE
CJAMIE
DDONNA
EDONNA
FDONNA
GJUSTIN
HJUSTIN
IJUSTIN

<tbody>
</tbody>




















Can someone help?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
You could use something like =IF(OR(LEFT(A1)="a",LEFT(A1)="b"...),"Person1",if(or(=IF(OR(LEFT(A1)="j",LEFT(A1)="k"...),"person2"

Kind of a pain to write it, but it will work.

Other option would be to vlookup the left letter to a table that then assigns to a person.
 
Upvote 0
Hi,

You just need to add the OR function like this:


Excel 2010
ABC
1suppliers that begin with:REP
2AJAMIEDONNA
3BJAMIEDONNA
4CJAMIEDONNA
5DDONNANA
6EDONNANA
7FDONNANA
8GJUSTINNA
9HJUSTINNA
10IJUSTINNA
Sheet30
Cell Formulas
RangeFormula
C2=IF(OR(LEFT(A5,1)={"D","E","F"}),B5,"NA")
 
Upvote 0
If I am understanding correctly and you just want to assign a sales rep to a list of suppliers with the only rule for assignment being the first letter of the supplier name, then I think an index-match would work well here.

=INDEX(B4:B12,MATCH(LEFT(E4,1),A4:A12,0))

Here column E is the incoming supplier list.
 
Upvote 0
Why not something like this?

ABCDE
1
2suppliers t
hat begin with:
REPNameRep
3AJAMIEExcellent VendorDONNA
4BJAMIE
5CJAMIE
6DDONNA
7EDONNA
8FDONNA
9GJUSTIN
10HJUSTIN
11IJUSTIN
12

<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet3

Worksheet Formulas
CellFormula
E3=VLOOKUP(LEFT(D3),$A$3:$B$11,2)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Hi!

If I understand what you want, maybe the formulas below can helps.

In F2 and copy down

=LOOKUP(CODE(UPPER(LEFT(D2,1))),{65;68;71;74},{"JAMIE";"DONNA";"JUSTIN";"NA"})

In G2 and copy down

=LOOKUP(CODE(UPPER(LEFT(D2,1))),{65;74},{"JAMIE";"NA"})

ABCDEFGH
1LetterCodesuppliers that begin with:REPFormula1Formula2
2A65AJAMIEJAMIEJAMIE
3B66BJAMIEJAMIEJAMIE
4C67CJAMIEJAMIEJAMIE
5D68DDONNADONNAJAMIE
6E69EDONNADONNAJAMIE
7F70FDONNADONNAJAMIE
8G71GJUSTINJUSTINJAMIE
9H72HJUSTINJUSTINJAMIE
10I73IJUSTINJUSTINJAMIE
11J74JNANA
12K75KNANA
13L76LNANA
14M77MNANA
15N78NNANA
16O79ONANA
17P80PNANA
18Q81QNANA
19R82RNANA
20S83SNANA
21T84TNANA
22U85UNANA
23V86VNANA
24W87WNANA
25X88XNANA
26Y89YNANA
27Z90ZNANA
28
******************************************************************

<tbody>
</tbody>


Markmzz
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,790
Members
451,589
Latest member
Harold14

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