If then help

Closed
jwafa123 - Dec 7, 2010 at 10:46 AM
 jwafa123 - Dec 8, 2010 at 01:22 PM
Hello,

I am trying to create a function to do the following.

If cell C2 contains an "S", then display "437" in E2
If cell C2 contains an "E", then display "423" in E2
If cell C2 has no value then E2 should have no value

Thanks

4 responses

Try this:

=IF( C2="S", 437, IF( C2="E", 423, IF(ISBLANK(C2), "", "Bad Data" )))

The "Bad Data" message is produced if the cell contains something other than an "S", "E" or is blank. This accounts for data entry errors.

Cheers!
0
The C column does contain other information (a 5-6 digit number with either an S or E at the end). I want the E to be blank if there is nothing in C. I am making a template worksheet that will be used to copy and paste many different sets of data all having different numbers of rows.

Thanks
0
=IF(RIGHT(C2,1)="S",437,IF(RIGHT(C2,1)="E",423,""))
0
Perfect. Thank you.
0