Building a Dashboard

Hello and Thank you for helping me with this project, so basically, I'm building a "Dashboard" to see all filter data in one place, based on dates, amounts, categories, etc.


This is pulling all the info from another tab, so I have a category name: "Status" (with WIN/LOSS Categories) I would like to pull the "WIN" but only by year and month, from the first table that controls everything, so if I change the month date from march to april and year 2023 to 2022, the amount will automaticaly will work, but for the secon table will not work because this is the formula that I have,


COUNTIF(Status,"WIN")

COUNTIF(Status,"LOSS")


indeed, it gives me the amount but, not by mounth or year, aslo, for the third, table "Aveg Hold Time" need another formula to pull the "aveg hold time:

AVERAGE(Avg Time) and it's working but not by month or year.


This is the first part of many issues I have lol. Thank you for all your help, building my Dashboard.


MacBook Pro 16″, macOS 13.3

Posted on Apr 30, 2023 5:15 PM

Reply
Question marked as Top-ranking reply

Posted on Apr 30, 2023 7:52 PM

COUNTIFS will let you specify multiple conditions.


Based on the formulas you posted, I assume you have the Numbers preference setting "use header names as labels" checked. It is easier to help when that is not checked and it uses the normal cell and range referencing.


If Status is Table 1::A and Date is Table 1::B and you want the wins for January 2023:

=COUNTIFS(Table 1::A,"win",Table 1::B,">="&DATE(2023,1,1),Table 1::B,"<"&DATE(2023,2,1))

20 replies
Question marked as Top-ranking reply

Apr 30, 2023 7:52 PM in response to RaulJ

COUNTIFS will let you specify multiple conditions.


Based on the formulas you posted, I assume you have the Numbers preference setting "use header names as labels" checked. It is easier to help when that is not checked and it uses the normal cell and range referencing.


If Status is Table 1::A and Date is Table 1::B and you want the wins for January 2023:

=COUNTIFS(Table 1::A,"win",Table 1::B,">="&DATE(2023,1,1),Table 1::B,"<"&DATE(2023,2,1))

May 1, 2023 10:00 AM in response to RaulJ

Working with dates can get a little complicated/long. You don't want to calculate the same thing repeatedly if not necessary. You'll need the date several times so I recommend adding a new column (column D) to your Control Panel table for the date and use this formula in cell D2:

=DATE(B2,MONTH(A2),1)


That is the first of the month. You can hide this column later.


EOMONTH can give the last day of that same month.


The entire formula for the Win column (column A), with all the necessary preserving of column references so you can drag-fill it to column B is:


=COUNTIFS(Table 1::$B,A$1,Table 1::$A,">="&Control Panel::$D2,Table 1::$A,"<="&EOMONTH(Control Panel::$D2,0))

May 1, 2023 10:32 AM in response to RaulJ

First, please turn off "use header names as reference".


Second, I apologize for not changing the name of my "Table 1" to "Reference", like in your spreadsheet.


Those two things plus it looks like you didn't recreate the formula accurately. You should be able to copy/paste the formula from here.


=COUNTIFS(Reference::$B,A$1,Reference::$A,">="&Control Panel::$D2,Reference::$A,"<="&EOMONTH(Control Panel::$D2,0))

May 1, 2023 6:00 PM in response to RaulJ

Use AVERAGEIFS and SUMIFS, the ones with the S at the end of their name. They will be very similar to how you did the COUNTIFS formula. You can read about them in Help->Formulas and Functions Help. Half the battle is knowing what functions are available (like knowing there is a SUMIFS as well as SUMIF), the other is figuring out how to get them to work. You now know which functions to use. You have the working COUNTIFS as a guide to using them correctly. Give it another try.

May 1, 2023 2:55 PM in response to RaulJ

The formulas for Avg hold time and #shares should be very similar in look to the COUNTIFS functions you just made, except using AVERAGEIFS and SUMIFS. If you want all of them to give consistent results (counting the same rows, averaging the same rows, and summing the same rows), they need to all use the same conditions.

May 5, 2023 4:23 PM in response to RaulJ

One of your date conditions is missing. The condition was in the formula you posted prior to this. Now it is gone. Sometimes (far too often) Numbers, in its attempt to be helpful, can totally screw up a formula when you try to edit it. Maybe that's what happened?


The condition ">="&A2 means "A2 or any other text/word that would come after it in a dictionary". The condition you want is just plain old A2 (which is the same as "="&A2).


Here is the formula. Hopefully it is correct. I did not recreate your spreadsheet to test it.

=SUMIFS(Reference::E,Reference::F,A2,Reference::$A,">="&Control Panel::$D$2,Reference::$A,"<="&EOMONTH(Control Panel::$D$2,0))





May 1, 2023 9:02 AM in response to Badunit

Thank you for your response Badunit, here's a better description of what I'm looking for so the control panel table is the one that will control everything, so I try to align all the other tables based on the month and year, so if i change the month and year everything will automatically change as well. I've put the reference table next to it so you can guide me through how to get the data by year and month, Thank you.

May 1, 2023 10:19 AM in response to Badunit

Thank you for your answer, I think, I'm doing something wrong, the formula since right but the names or the format don't get it, do you want me to add titles of the cell so that way, I can select the right column and cell?


COUNTIFS(Status,1,$A2,">="&Control Panel::$D2,$A,"<="&EOMONTH(Control Panel::$D2,0))

May 1, 2023 12:23 PM in response to RaulJ

I was able to do the sumif, for the amount, category, but again I have the issue for the Date and Month, I want to be able to change the month and year so I can get the results or sum or average for the month/year. I'm using the "TRUE"/FALSE" statement and I was able to get the amount for that month and year, if I change to different month and year it works the sum, but for Win/lose table, System Table, and Retun Table I would love to do the same, so at the end, I can get my charts easly for my dashboard. Would you mind sharing all the formulas?

May 1, 2023 12:48 PM in response to RaulJ

You have added a new column to your Reference table that was not there when I wrote the formula or when I last said it could be copy/pasted from my post. You will have to edit the formula so it refers to the correct columns of your newly designed Reference table. Or put the Reference table back like it was until the problem at hand is fixed.


The A$1 you circled is the part that was incorrect before. It was just a 1 in your earlier screenshot. It should be a cell reference, though. I do not understand why it is not. It should be a reference to the cell directly above that has the word "Win" in it. Numbers does weird things sometimes. Select that A$1 in the formula then click on cell A1. That should delete the text A$1 and replace it with the cell reference. If that doesn't work, replace it with "win" in this formula and replace it with "lose" in the one next to it (like you had in your original formulas).

May 1, 2023 2:00 PM in response to Badunit

Yeap, that was the issue, the word "win/loss", Ok I got it, now, can I use the count formula for the "avg hold time" and "shares" tables? can you help me with that too, or do I need to use the sum if, again this is based on months and years for the Control Panel Table?


Also, the system, shares, and return table is working but not by M/Y.

May 2, 2023 8:10 AM in response to Badunit

Thank you for helping me, I was able to do the Ave and $ shares, but for the other System and Return, It does not work, can you check my formula please? Also if there is no value or empty how to add "-" with if error or ifs error and where do I added?


SUMIFS(Reference::E,Reference::$F$3,Reference::F,">="&Control Panel::$D$2,Reference::$A,"<="&EOMONTH(Control Panel::$D$2,0))


SUMIFS(Reference::A,Reference::E,Reference::A,">="&Control Panel::$D$2,Reference::$A,"<="&EOMONTH(Control Panel::$D$2,0))



May 2, 2023 1:46 PM in response to RaulJ

You can do this. Be more careful. Take another look at the description of the SUMIFS formula and take another look at your formulas.


SUMIFS(sum-values, test-values, condition, test-values, condition, and so on and so on)


Your formulas do not follow that pattern.

You formula for #shares appears to work. It uses the same SUMIFS function. Use it as your guide.


Specific to your formula for cell System::B2:

You are using cell Reference::F3 to get the word "Pegasus". You should be referencing System::A2.


Specific to your formula for cell Return::B2:

If it is supposed to be adding up the amounts from the prior month (a month prior to the one in Control Panel), I think the two conditions you want are


">"&EOMONTH(Control Panel::$D$2,-2)

and

"<="&EOMONTH(Control Panel::$D$2,-1)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Building a Dashboard

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