COUNTA, Concatenate and SUMIF

El Gallo

New Member
Joined
Sep 12, 2020
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'd like to concatenate values from two columns if they match the criteria from another sheet. Here's what I've come up with so far but I just can't get it give me the correct values:

=IF(COUNTA(SUMIF('Work submitted'!$A$2:$A$250,A2,'Work submitted'!$C$2:$C$250)=1),CONCATENATE(SUMIF('Work submitted'!$A$2:$A$250,A2,'Work submitted'!$B$2:$B$250)&" "&(SUMIF('Work submitted'!$A$2:$A$250,A2,'Work submitted'!$C$2:$C$250))),(SUMIF('Work submitted'!$A$2:$A$250,A2,'Work submitted'!$B$2:$B$250)))

The data I want is a score and if it was late. If it wasn't late, all I want is the score.
 
That's the one! Thank you so much! Teaching from home has been rough and your help will make it a lot easier. I am so grateful. And sorry about the cross post.
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
That's the one! Thank you so much! Teaching from home has been rough and your help will make it a lot easier. I am so grateful. And sorry about the cross post.

If you don't mind, what are the principles I was missing out on?
 
Upvote 0
Ok, how about
Excel Formula:
=CONCATENATE(SUMIF('Work submitted'!$A$2:$A$250,A2,'Work submitted'!$B$2:$B$250)&IF(COUNTIFS('Work submitted'!$A$2:$A$250,A2,'Work submitted'!$C$2:$C$250,"x")>0, " x",""))

That's the one! Thank you so much. Teaching from home has been rough and this will make it quite a bit easier. I am so grateful to you. And sorry about the cross post. What a rookie... :eek:)

If you don't mind, what were the principles I was missing out on?
 
Upvote 0
The main problem was the part in blue
Rich (BB code):
 =IF(COUNTA(SUMIF('Work submitted'!$A$2:$A$250,A2,'Work submitted'!$C$2:$C$250)=1),CONCATENATE(SUMIF('Work submitted'!$A$2:$A$250,A2,'Work submitted'!$B$2:$B$250)&" "&(SUMIF('Work submitted'!$A$2:$A$250,A2,'Work submitted'!$C$2:$C$250))),(SUMIF('Work submitted'!$A$2:$A$250,A2,'Work submitted'!$B$2:$B$250)))
as it will always return 1 (which is treated as true), so the false part of the IF will never get looked at.
Also the part in red is trying to sum col C, part that column only has xs in it which can't be summed.
 
Upvote 0
Ah, I see that now. Is there a way to “sumif” for text? I tried just using the “=” but clearly that wasn’t working and google has next to nothing for that search.
 
Upvote 0
You can only sum numbers, not text.
 
Upvote 0
I'm afraid you are not making much sense.
You can find text, but you cannot sum it.
 
Upvote 0
I want to learn the formula for finding whatever text might bin in a cell of column C only if the name is in column A... Hopefully that makes sense. :0) In the original example I wanted James Carter's grade (which would be found in a cell of column B) and whether or not it's late (which would be found in a cell of column C). But I'd like to enter other information than just the "x" and have that formula return with the other information. I tried COUNTA but that doesn't work either, for obvious reasons.
 
Upvote 0
Ok, how about
Excel Formula:
=SUM(FILTER(Table1[Total points],Table1[Name]=A2,0))&" "&TEXTJOIN(", ",,FILTER(Table1[Late],Table1[Name]=A2,""))
 
Upvote 0

Forum statistics

Threads
1,215,001
Messages
6,122,648
Members
449,092
Latest member
peppernaut

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