Two formulas in one cell calling by table name

Outdoorsman80

Board Regular
Joined
Oct 4, 2014
Messages
61
Office Version
  1. 365
Platform
  1. Windows
I posted a thread awhile ago on two formulas in one cell and that worked great, but I've found that I like calling tabled data and am trying to do something a little different.

I have a table "tblItems" that has a ton of data in it. I have a formula that looks for a keyword and year to get me a total of that item in one year
Data.xlsx
AB
16Broilers Total17
OO Dash
Cell Formulas
RangeFormula
B16B16=+SUM(SUMIFS(tblItems[Amount],tblItems[Description], {"Broiler"}, tblItems[Date],">="&DATE(2021,1,1), tblItems[Date], "<="&DATE(2021,12,31), tblItems[In Place], {"Yes","No"}))


Inside of B16 cell, where it says 17, like for it to actually say something like this based on another calculation:
17 (x Died)

Now, in the formula, under "In Place", there's a Yes No and Died. I've tried a few different variations but Excel keeps "Spilling" my formula and am not sure why.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Inside of B16 cell, where it says 17, like for it to actually say something like this based on another calculation:
17 (x Died)
To do something like that you would need to use a formula on the basis of =SUMIFS(....)&" ("&SUMIFS(...,"died")&" died") where the second sumifs counts the number that died.

Without the source table to see what we are looking at, there is not enough information for us to write the full formula correctly.
 
Upvote 0
The source would be In Place, Yes, No, Died.

Here's a sample of the source (tblItems):
Source.xlsx
FGHI
42DateDescriptionAmountIn Place
434/29/2021Broiler1Yes
444/29/2020Broiler1No
454/29/2021Broiler1Died
Sheet1
 
Upvote 0
I thought that I posted this earlier but it didn't submit correctly for some reason.

I'm assuming that based on those 3 rows, the result should be "2 (1 died)"?
Excel Formula:
=SUM(SUMIFS(tblItems[Amount],tblItems[Description], "Broiler", tblItems[Date],">="&DATE(2021,1,1), tblItems[Date], "<="&DATE(2021,12,31), tblItems[In Place], {"Yes","No"}))&" ("&SUMIFS(tblItems[Amount],tblItems[Description], "Broiler", tblItems[Date],">="&DATE(2021,1,1), tblItems[Date], "<="&DATE(2021,12,31), tblItems[In Place], "Died")&" died)"
 
Upvote 0
Solution
I'm trying to figure this one out on my own here but it's just not working. In the same cell, I wanted to have it calculate this out:
21 (4 died, 17 processed)

Excel Formula:
=SUM(SUMIFS(tblItems[Amount],tblItems[Description], "Broiler", tblItems[Date],">="&DATE(2021,1,1), tblItems[Date], "<="&DATE(2021,12,31)))
&" ("&SUMIFS(tblItems[Amount],tblItems[Description], "Broiler", tblItems[Date],">="&DATE(2021,1,1), tblItems[Date], "<="&DATE(2021,12,31), tblItems[In Place], "Died")&" died, )"
&" ("&SUMIFS(tblItems[Amount],tblItems[Description], {"Broiler"}, tblItems[Date],">="&DATE(2021,1,1), tblItems[Date], "<="&DATE(2021,12,31), tblItems[In Place], {"Yes","No"}) &" Processed")"

It will count all purchased in a year, then, the ones that died in that year, then simple math or formula to subtract the two numbers to get the total processed. What am I doing wrong?
 
Upvote 0
I haven't set up a test sheet, at a quick glance it looks like you're missing SUM() on the last part. You don't need it on the first part as there is no array.
Excel Formula:
=SUMIFS(tblItems[Amount],tblItems[Description], "Broiler", tblItems[Date],">="&DATE(2021,1,1), tblItems[Date], "<="&DATE(2021,12,31))
&" ("&SUMIFS(tblItems[Amount],tblItems[Description], "Broiler", tblItems[Date],">="&DATE(2021,1,1), tblItems[Date], "<="&DATE(2021,12,31), tblItems[In Place], "Died")&" died, "
&SUM(SUMIFS(tblItems[Amount],tblItems[Description], {"Broiler"}, tblItems[Date],">="&DATE(2021,1,1), tblItems[Date], "<="&DATE(2021,12,31), tblItems[In Place], {"Yes","No"})) &" Processed")"

I took out the closing bracket in " died, )" and removed the " ("& part at the start of the next line as they would have given you "21 (4 died, )(17 Processed)"
 
Upvote 0
I got this; tried tweaking it some but I'm still trying to grasp these advanced equations.

snip.PNG
 
Upvote 0
There's a mistake right at the end that I missed, one to many double quotes.
Excel Formula:
=SUMIFS(tblItems[Amount],tblItems[Description], "Broiler", tblItems[Date],">="&DATE(2021,1,1), tblItems[Date], "<="&DATE(2021,12,31))
&" ("&SUMIFS(tblItems[Amount],tblItems[Description], "Broiler", tblItems[Date],">="&DATE(2021,1,1), tblItems[Date], "<="&DATE(2021,12,31), tblItems[In Place], "Died")&" died, "
&SUM(SUMIFS(tblItems[Amount],tblItems[Description], {"Broiler"}, tblItems[Date],">="&DATE(2021,1,1), tblItems[Date], "<="&DATE(2021,12,31), tblItems[In Place], {"Yes","No"})) &" Processed)"
 
Upvote 0

Forum statistics

Threads
1,215,329
Messages
6,124,301
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top