Sumifs

mypig7

Active Member
Joined
Sep 27, 2004
Messages
285
I have 2 columns on Sheet 2

In column A it says Mon all the way down to A10
Then Tues for a few more cells below, then Weds for a few cells and so on.
The list is sorted in order

To the right in Column B some cells have numbers in them and some are blank
On Sheet 1 I want a summary, so it would say:

"Mon" in one cell (say in A1)
And to the right of Mon a sum of the cells that appear next to Mon in Column B (Sheet 2) that have something in them.

How do I do it?

Tried a combination of AND, SUMIFS and am not getting there

I tried this with no joy on sheet 1:

=SUMIFS(Sheet2!B:B,Sheet2!A:A,"Mon",Sheet2!B:B,">0")
 

Some videos you may like

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

FormR

MrExcel MVP
Joined
Aug 18, 2011
Messages
6,409
Office Version
365
Platform
Windows
a sum of the cells
Do you mean you want to count the number of cells that fulfill the criteria?

If so - maybe you can try like this.

=COUNTIFS(Sheet2!A:A,"Mon",Sheet2!B:B,">0")

Or with "Mon" in A1

=COUNTIFS(Sheet2!A:A,A1,Sheet2!B:B,">0")
 

FormR

MrExcel MVP
Joined
Aug 18, 2011
Messages
6,409
Office Version
365
Platform
Windows
Then the formula you have should work, although if you aren't specifically trying to exclude negative values from the sum you don't need the second criteria.

Perhaps you can expand on "no joy" - are you getting an error, or a wrong result or something else?

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style="text-align: right;color: #333333;;">18</td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">A1</th><td style="text-align:left">=SUMIFS(<font color="Blue">Sheet2!B:B,Sheet2!A:A,"Mon",Sheet2!B:B,">0"</font>)</td></tr></tbody></table></td></tr></table><br />

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style=";">Mon</td><td style="text-align: right;;">1</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style=";">Mon</td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style=";">Mon</td><td style="text-align: right;;">10</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style=";">Mon</td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style=";">Mon</td><td style="text-align: right;;">6</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">6</td><td style=";">Mon</td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">7</td><td style=";">Mon</td><td style="text-align: right;;">1</td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet2</p><br /><br />
 

mypig7

Active Member
Joined
Sep 27, 2004
Messages
285
Hi, I just get 0 as the answer, when there are def figs in the cells that can be added up
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
53,646
Office Version
365
Platform
Windows
Are the values in column A really text values like "Mon", or are they dates with custom formats?

If you apply the LEN function to one of the entries with "Mon" in it, what do you get?
So, if cell A2 has "Mon", enter this formula somewhere and tell us what it returns:
=LEN(A2)
 

Watch MrExcel Video

Forum statistics

Threads
1,102,266
Messages
5,485,763
Members
407,514
Latest member
viego99

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top