Solved

Excel Formula which tests a string

Posted on 2013-05-19
4
283 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

717 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