Return value based on different criteria

Namescody

New Member
Joined
Aug 24, 2017
Messages
3
Hello everyone,

I know this is probably easy - but for some reason I'm having trouble with getting a formula to work correctly. I am trying to populate a certain value in Column D based on different criteria in Column F.

Column F will contain "ABC Employee Name" or "XYZ Employee Name" or "DEF Employee Name" or "LMN Employee Name"

and I want Column D to auto-populate with a value for each prefix.

I.E. If Column F contains "ABC Employee Name" return 123 in Column D
If Column F contains "XYZ Employee Name" return 456 in Column D

and so on...
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Re: [Help]Return value based on different criteria

Hello,

Try this out

=IF(LEFT(F1,3)="ABC",123,IF(LEFT(F1,3)="XYZ",456,0))

add an additional if statement for each prefix and each result that you would like to have
 
Upvote 0
Re: [Help]Return value based on different criteria

Thanks! That worked, originally I got an error of too many arguments so I just removed the ",0" at the end of each.

Hello,

Try this out

=IF(LEFT(F1,3)="ABC",123,IF(LEFT(F1,3)="XYZ",456,0))

add an additional if statement for each prefix and each result that you would like to have
 
Upvote 0
Re: [Help]Return value based on different criteria

Ahh yeah must have overlooked that!

Glad i could help
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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