+ Reply to Thread
Results 1 to 7 of 7

SUMIF based on Multiple parameters not working

  1. #1
    Registered User
    Join Date
    02-05-2015
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    16

    SUMIF based on Multiple parameters not working

    Hi, I'm working on making myself a good Spreadsheet for my Crypto Taxes.

    I found this free spreadsheet here which I want to improve (not allowed to publish links, so I separated them:
    Blog Article: tokeneconomy. co/crypto-tax-calculation-via-google-sheets-fifo-abc-584a11a3da22
    Spreadsheet: docs. google. com/spreadsheets/d/1PBRyOlLQLH7bzP55XB2hQfAFQSA3YbyTv9kKy6XOlWU/edit#gid=0

    To make this fit my own country's laws, I have added another sheet in the spreadsheet where I want to track the profit/loss for every asset/coin for each year. So far I have managed to get it working to sum this without any year argument in this query:
    =SUMIF(Tax!A:A,A5,Tax!V:V)

    But when I'm trying to add from/to date for selection within years, it seems like SUMIF doesn't allow that many arguments. I tried with this query which failed:
    =SUMIF(Tax!A:A,A25,Tax!V:V,Tax!F:F,">=1/1/2019",Tax!F:F,"<1/1/2020")

    "A25" is from the new sheet where I have listed my assets like BTC, ETH, LTC etc. A25 changes dynamically based on the row I put the query into so I don't have to change the argument into BTC or ETH or whatever I want to select. So instead of A25 I could have used "*BTC*" or "*ETH*".

    Anyway, my main problem is adding all of these arguments in a single query. Do you have any suggestions?

    If you need any access to the spreadsheet I'll make a copy for you.
    Last edited by mikeey89; 08-10-2019 at 07:11 AM. Reason: Solved

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,805

    Re: SUMIF based on Multiple parameters not working

    Welcome to the forum.

    Looks like you will need SUMIFS, which allows multiple criteria.

    Attach the workbook here, please. You don't need to post links.

    Unfortunately the attachment icon doesn't work at the moment (it hasn't worked for years, and despite our repeatedly asking the technical team who own the forum to fix it, they can't be bothered to do so), so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    02-05-2015
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    16

    Re: SUMIF based on Multiple parameters not working

    Hi, you can see my workbook here (edit access):
    This is for testing purposes only, so you can play around with it as you like.

    docs. google. com/spreadsheets/d/15qmZP89NTSRQZFURZH9Pa4bW5rAMmduU56mRXkyHkVc/edit?usp=sharing

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: SUMIF based on Multiple parameters not working

    Please post your wbk on the forum as requested
    External links can be unsafe and not all members can use them. Thx

  5. #5
    Registered User
    Join Date
    02-05-2015
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    16

    Re: SUMIF based on Multiple parameters not working

    Here's the workbook

  6. #6
    Registered User
    Join Date
    02-05-2015
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    16

    Re: SUMIF based on Multiple parameters not working

    I Think I solved it.

    Taking a break sometimes do magic to the brain
    Here's the solution:
    =SUMIFS(Tax!V:V,Tax!F:F,">=1/1/2019",Tax!F:F,"<1/1/2020",Tax!A:A,A25)

    The trick was to place the arguments in the correct order.

    Now the next question:
    Do you know about a way to populate the traded assets into "Overview Profit/loss!A:A" automatically based on "TAX!A:A"?

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,805

    Re: SUMIF based on Multiple parameters not working

    Well done!

    The next question is different, so please start a new, appropriately titled thread.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Countif and sumif columns based on another cells as parameters
    By MyStix01 in forum Excel General
    Replies: 3
    Last Post: 11-27-2018, 08:31 AM
  2. list data on summary sheet from multiple sheets, based on parameters
    By tillyman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-11-2015, 10:06 AM
  3. Sumif a range based on multiple parameters
    By ifthenelsenull in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-14-2014, 05:21 AM
  4. working with sumif based on the date
    By darkhangelsk in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-24-2013, 01:46 PM
  5. Date calculation based on multiple parameters
    By koudesak in forum Outlook Formatting & Functions
    Replies: 2
    Last Post: 10-03-2011, 10:18 AM
  6. Max based on multiple variables with multiple parameters
    By Latszer in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 10-09-2009, 03:39 AM
  7. Query and sum based on multiple parameters
    By minkus in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-30-2007, 04:34 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1