Two formulae in same cell

The Grim Discovery

Board Regular
Joined
Jan 23, 2015
Messages
244
Office Version
  1. 365
Platform
  1. Windows
Hello Legends

I've got a column of data containing the follow formula

COUNTIFS('Primary'!$A$2:$A$5000,B$1,'Primary'!$D$2:$D$5000,$A2)&"/"&COUNTIFS('Secondary'!$A$2:$A$5000,B$1,'Secondary'!$D$2:$D$5000,$A2)

This works well in each cell as it gives me what I'm looking for a number for: 'primary' / a number for 'secondary' - but i need to produce a total for this column which sums up all the 'primary' formulae separately from 'secondary' formulae. Is there anyway of doing this that doesn't include helper columns.

Thanks
Primary/Secondary
2/3
7/9
1/8
Total:
10/20<<Trying to achieve this
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
try
=SUM(TEXTBEFORE(A2:A4,"/")*1)
and
=SUM(TEXTafter(A2:A4,"/")*1)

so =SUM(TEXTBEFORE(A2:A4,"/")*1)&"/"&SUM(TEXTAFTER(A2:A4,"/")*1)

Book3
A
1Primary/Secondary
22/3
37/9
41/8
5Total:
610/20
Sheet1
Cell Formulas
RangeFormula
A6A6=SUM(TEXTBEFORE(A2:A4,"/")*1)&"/"&SUM(TEXTAFTER(A2:A4,"/")*1)
 
Upvote 0
Solution
try
=SUM(TEXTBEFORE(A2:A4,"/")*1)
and
=SUM(TEXTafter(A2:A4,"/")*1)

so =SUM(TEXTBEFORE(A2:A4,"/")*1)&"/"&SUM(TEXTAFTER(A2:A4,"/")*1)

Book3
A
1Primary/Secondary
22/3
37/9
41/8
5Total:
610/20
Sheet1
Cell Formulas
RangeFormula
A6A6=SUM(TEXTBEFORE(A2:A4,"/")*1)&"/"&SUM(TEXTAFTER(A2:A4,"/")*1)
That's brilliant. Thank you. Never come across the TEXTBEFORE and AFTER. Thanks again.
 
Upvote 0
you are welcome
a lot of text functions added to 365v version now
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

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