Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Excel Formula which tests a string

Posted on 2013-05-19
4
Medium Priority
?
293 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 15

Accepted Solution

by:
Juan Ocasio earned 2000 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 15

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 15

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

971 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