You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Apple Numbers, my first use of Sumif...duh

To understand my problem with Apple numbers it would be clearer if you just recreated it. This is for simple stock trading, - (buy low, sell high) = long, (buy high, sell low) = short, both can be profitable, so ($100) in a short is a win. 


COLUMNS;

  1. (Col B) Qty# 
  2. (Col D) SHORT (checkbox) if checked = Short, if not = Long
  3. (Col E) Entry $price
  4. (Col F) Exit $price
  5. (Col K) Long$ (Q3−P3) calculates the win or loss
  6. (Col L) Short$ (P3−Q3) calculates the win or loss
  7. (Col P) Invested $Total (E3×ROUND($B3,4))
  8. (Col Q) Gain/Loss $ (F3×B3)
  9. (Col K16) Sums column L for the Long trades (SUMIF(D3:D14,"=false",K3:K14)
  10. (Col L16) Sums column M for the Short trades (SUMIF(D3:D14,"=True",L3:L14)
  11. (Col M16) adds Long & Short Total (SUM(K16,L16)


WORKFLOW, (Enter these values to easily see problem)

  1. Stock Ticker (Not Needed)
  2. Enter Qty (10 for each of the 4 trades)
  3. Check if SHORT or Unchecked if LONG (Short, Long, Short, Long)
  4. Enter Entry Price ($100. For each of the 4 trades)
  5. Enter Exit Price ($90, $110, $90, $110)


CALCULATIONS ARE…

Col K (Long) (Q3−P3) 

Col L (Short) (P3−Q3)

Col P ($ Invested Total) (E3×ROUND($B3,4)

Col Q ($ Profit/Loss) (F3×B3)


VALUES I HAVE…

Total for Long K16 should be $200

Total for Short L16 should be $200

Grand Total M16 should be $400.


PROBLEM:

If you have everything the way I have it you should see ($400 Total).

 

Now All trades are Wins (2 long wins and 2 short wins)


If I accidentally DIDN’T check Col D6 to make it a Short

and then I DID check it turning it into a short, now it shows a

Loss. Notice what happens in the $400 Total.


A correction of a $100 profit (as a Long) now turns into a

$100 Loss (as a Long) on the 4th trade.


This is where I get lost.

$100 profit is actually a $100 loss which is a $200 difference.

BUT the trade ONLY has a $100 Value. 


So which is it, and how do I correct it? 


Sorry for the long post, 

Thank you 


I don’t think I can send the spreadsheet it says I need to update OS and Numbers.

Running Ventura 13.6.8 Numbers 14.1 (7040.0.73).


Areas that are greyed out have no relevance to the problem.

iMac 27″

Posted on Nov 30, 2024 2:03 PM

Reply
2 replies

Nov 30, 2024 3:34 PM in response to Bill K

Hi Bill,



Syntax for SUMIF: SUMIF(test-values, condition, sum-values)

Formula in K15 is SUMIF($D,FALSE,K)

Formula in K15 is SUMIF($D,TRUE,K)


Bill K wrote:

If I accidentally DIDN’T check Col D6 to make it a Short
and then I DID check it turning it into a short, now it shows a
Loss. Notice what happens in the $400 Total.

I'm not sure what you mean. D6 did not feature in your example. What brings it in now?


Regards,

Ian.

Nov 30, 2024 4:27 PM in response to Yellowbox

Hi Ian,

Sorry for my typo, I mean D5.

So then you'll see the $200 reduction, instead of what I think should be only $100?

The checkbox column D toggles between adding/subtracting from the appropriate column

either the Long or Short column.


At one point I thought what if when the value is a $100 win in the Long column and then instead

of a ($100) deduction being put in the Short column it puts a $0 then it would only be a $100 change.


Of course if it is a True loss then it would be correct to have ($100) to calculate properly

Thanks for the super quick reply Ian.

Billy

Apple Numbers, my first use of Sumif...duh

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.