Solved

Excel Formula which tests a string

Posted on 2013-05-19
4
272 Views
Last Modified: 2013-05-19
If contents of E3 = "Loss"
  value of G3 = -1 * contents of D3
If contents of E3 = "Win"
  value of G3 = ABS(D3)

I need to create a formula for cell G3 based on contents of E3 and D3 as described above.

Help is needed.
0
Comment
Question by:supportoranges
  • 3
4 Comments
 
LVL 14

Accepted Solution

by:
Juan Ocasio earned 500 total points
ID: 39178528
=IF(E3="LOSS",D3*-1,ABS(D3))

or if you're may have something other than WIN or Loss:

=IF(E3="LOSS",D3*-1,IF(E3="WIN",ABS(D3),""))
0
 
LVL 14

Expert Comment

by:Juan Ocasio
ID: 39178532
Here is another way to make sure that Win, WIN, win, Loss, LOSS, loss get identified:

=IF(UPPER(E3)="LOSS",D3*-1,IF(UPPER(E3)="WIN",ABS(D3),""))
0
 
LVL 1

Author Closing Comment

by:supportoranges
ID: 39178544
Thank you for this quick answer on the weekend.  It is really appreciated!
0
 
LVL 14

Expert Comment

by:Juan Ocasio
ID: 39178550
No problem!  Just reply to this chain if you need additional help or come across an outlier that isn't addressed here!

jocasio
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question