Can you add up cells that have returned TRUE as the answer to SUMIF formula

zoepryce

New Member
Joined
Oct 30, 2023
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Can you add up cells that have returned TRUE as the answer to SUMIF formula? I'm getting a value error. Thanks
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
no
you could use a countif , as each occurance will be a 1
=COUNTIF(range with the true / false in,TRUE)

i'm assuming the same column
or do you want to sum a different column base on the other column row having a TRUE
then sumif() will work

=SUMIF(range with true in,TRUE,range with numbers to sum)

Book2
AB
1
2TRUE1
3TRUE5
4FALSE4
5FALSE3
6COUNTSUM
726
Sheet1
Cell Formulas
RangeFormula
A7A7=COUNTIF(A2:A5,TRUE)
B7B7=SUMIF(A2:A5,TRUE,B2:B5)


otherwise

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Upvote 0
TOTAL TRUE.PNG
In the Blue total boxes, I wanted to add up the ones that show TRUE. So the yellow ones are pulling through but not the green ones- any idea why? I've just got the formula in as =P4+U4+Y4. Thank you
 
Upvote 0
dont understand - from the image
 
Upvote 0
you can add TRUE as you have done

Not sure why you have a value - I suspect because the TRUE is not a logical true - but text

also with the layout not sure why
=P4+U4+Y4

if column A - 1 is P
then B-1 is T and X

Book2
JKLMNOPQRSTUVWXYZAAAB
1TotalABC
21234123412341234
30100TRUE
40030TRUETRUETRUE
50000
60000
70000
8
Sheet1
Cell Formulas
RangeFormula
L3:O7L3=P3+T3+X3
 
Upvote 0
@zoepryce, you are not closing out any of your threads so we can't tell if you have working solution or not.
Also ideally provide a sample of your data using XL2BB. If you resort to an image at least include the Row and Column references.

See if the below works for you.
(not sure I have the columns aligned to your data but its my best guess from the image and formula your provided)

If you need it to work on pre:MS 365 change the SUM to SUMPRODUCT

Book1
KLMNOPQRSTUVWXYZ
1TotalABC
21234123412341234
31200TRUETRUETRUE
40003TRUETRUETRUE
50010TRUE
60110TRUETRUE
Data
Cell Formulas
RangeFormula
K3:N6K3=SUM(($O$2:$Z$2=K$2)*($O3:$Z3=TRUE))
 
Upvote 0
Use COUNTIFS?

23 11 18.xlsm
KLMNOPQRSTUVWXYZ
1TotalABC
21234123412341234
31200TRUETRUETRUE
40003TRUETRUETRUE
50010TRUE
60110TRUETRUE
Countifs
Cell Formulas
RangeFormula
K3:N6K3=COUNTIFS($O$2:$Z$2,K$2,$O3:$Z3,TRUE)
 
Upvote 0

Forum statistics

Threads
1,216,518
Messages
6,131,121
Members
449,624
Latest member
MandlaMan

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