Fill cells if adjacent cell match criteria

J

Jess

I have a large worksheet and hate to use the fill down for this.

Here's my scenario:

In column A there are different values. Examples: ADJ, REFUND, TUI, STE,
BKS, etc.
In column B, I need there to be an A or an E depending on which value is in
column A. So, if ADJ, TUI or STE are in column A, an A would go in column B.
If the value in Column A is REFUND or BKS, then E would go in Column B.

Any suggestions on how to make this work?

Thanks!
 
P

Peo Sjoblom

One way

=IF(OR(A1={"ADJ";"TUI";"STE"}),"A",IF(OR(A1={"REFUND";"BKS"}),"E",""))

assuming they start in A1, copy down as long as needed

--

Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
"It is a good thing to follow the first law of holes;
if you are in one stop digging." Lord Healey
 
M

Marcelo

Jesss

try yo use

=if(or((a:A="refund"),(a:a="bks"));"E";"A")

regards from Brazil
Marcelo

"Jess" escreveu:
 
M

Marcelo

Jess,

try

IF(OR((A:A="REFUND"),(A:A="BKS")),"E","A")

Regards from Brazil
Marcelo

"Jess" escreveu:
 
C

CWillis

This may help:

Sub testing()
Dim rowassignment
Dim numberofrows

numberofrows = 6

For rowassignment = 1 To numberofrows
For x = 1 To 5
If Cells(rowassignment, 1).Value = "ADJ" Then
Cells(rowassignment, 2).Value = "A"
Else: Cells(rowassignment, 2).Value = "E"
End If
Next x
Next rowassignment
End Sub

I don't know how to make it check for more than one value (i.e. "ADJ") so
unless someone else can help, you will have to copy and paste the above,
changing what it is checking for each time in the macro. Hope this helps.
 
E

Erin

=IF(OR(A1="ADJ", A1="TUI", A1="STE"),"A",IF(OR(A1="REFUND", A1="BKS"),"E",""))

I hope this helps.

Erin
 
Top