Avatar of ssblue
ssblue
Flag for United States of America asked on

Excel IF statement

column C (ActType) has the following items in it:  PRDIEM  PSNEOT  PSNE1  PSCROT  PSPR1  PSPR2

I need to fill column K (GL) with the appropriate GL acct #'s:  800100  800110  800200

Based on the following:

PRDIEM  is  800200
PSNEOT  is  800110
PSNE1  is  800100
PSCROT  is  800110
PSPR1  is  800100
PSPR2  is  800100
Microsoft OfficeMicrosoft ExcelSpreadsheets

Avatar of undefined
Last Comment
ssblue

8/22/2022 - Mon
Shums Faruk

Assuming your data starts from K2, use below formula:
=IF(C2="PRDIEM","800200",IF(OR(C2="PSNEOT",C2="PSCROT"),"800110",IF(OR(C2="PSNE1",C2="PSPR1",C2="PSPR2"),"800100")))

Open in new window

Else create a Table in Sheet2 and do the vlookup with below formula:
=IFERROR(VLOOKUP(C2,Sheet2!A:B,2,0),"")

Open in new window

ssblue_GL-Account.xlsx
ssblue

ASKER
the top equation is returning TRUE
ASKER CERTIFIED SOLUTION
Shums Faruk

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ssblue

ASKER
Thanks!
Your help has saved me hundreds of hours of internet surfing.
fblack61