Options

Another Excel Formula Question!

deans6571deans6571 Posts: 6,137
Forum Member
Ok, so I have a spreadsheet showing the number of trades for any given month.

Column M shows if the trade was a BUY trade (B) or a SELL trade (S).

Using the COUNTIF formula in a field at the end of the spreadsheet, shows me the number of B trades and also the number of S trades.

So my exact formula is as follows:

In column M and row 1041, I have the formula: =COUNTIF(M2:M1037,"B") - which shows the total B trades.

and,

In column M, row 1042, I have the formula: =COUNTIF(M2:M1037,"S") - which shows the total S trades

So this works fine.

However, I also have a column (column AF) which shows some Private Trades. In this column, Private Trades are shown as having 999 in their row.

How can I use a formula to count just the Private B trades and just the Private S trades?

Thanks in advance!

Comments

  • Options
    Paul_DNAPPaul_DNAP Posts: 26,041
    Forum Member
    ✭✭✭
    You need to upgrade your COUNTIF to the plural COUNTIFS

    try

    =COUNTIFS(M2:M1037,"B",AF2:AF1037,999)


    In my test sheet I've got B/S in colB and 999 for private in colC and then X for exclusive in colD and I've just nested three in one formula to tell me the number of exclusive private buys... =COUNTIFS(B1:B16,"B",C1:C16,999,D1:D16,"X")
  • Options
    deans6571deans6571 Posts: 6,137
    Forum Member
    Paul_DNAP wrote: »
    You need to upgrade your COUNTIF to the plural COUNTIFS

    try

    =COUNTIFS(M2:M1037,"B",AF2:AF1037,"P")

    assuming there you've flagged privates with a P in col AF

    AWSOME!!!!

    That works!!!!

    Appreciated Paul_DNAP ;-)
  • Options
    gemma-the-huskygemma-the-husky Posts: 18,116
    Forum Member
    ✭✭
    If you have over 1000 rows of trades, it might be worth learning how to achieve this in Access.
Sign In or Register to comment.