Sum of a cell if certain criteria are met.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know this is probably easy, but for some reason I am having a hard time
with it. Here's what I want to do.

IF A1=L THEN C1-B1
IF A1=S THEN B1-C1

Not that it matters, but L=Long, S=Short (I trade stocks) If I take a long
position, then I need to subtract the entry price from the exit price and
vice versa.

I would like the sum of that to appear in the cell I put that formula in.

Any help would be great!

Thanks again!
 
If A1 can only hold L or S then:

=IF(A1="L",C1-B1,B1-C1)

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
Hi,

Try this:

=IF(A1=L,C1-B1,IF(A1=S,B1-C1,""))

you didn't mention that what should happen if A1 would not be L or S. so i
put nothing ("").

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top