Forum Discussion
formula "if" "and"
it looks like a COUNTIF or COUNTIFS can be used here. Is column A on tab 2 (month) text or a date? If it is just text "january" (as opposed to a date like 2023-01-01 but formatted to show only the month: 'january') then:
=COUNTIF('Tab 2'!A2:A100, "january")
if that is a date and the date could be any date in Jan then you could use countifs with a date range from 1/1 to 1/31 (but I don't think this is the case so I won't confuse the issue)
that said however I might recommend you format the data in Tab 2 as a table (Home -> 'Format as a Table') and then name that table (e.g. the default is Table1) and then you can use the following formatting and not worry if your data grows past row 100 in the above example:
=COUNTIF( Table1[month], "january" )
- mtarlerDec 09, 2023Silver Contributorok then use SUMIF or SUMIFS
=SUMIFS( Tab2!C:C, Tab2!A:A, "January")
or you could base it on the cell on Tab1 (I think that January is in cell B5)
=SUMIFS( Tab2!C:C, Tab2!$A:$A, $B$5 )- jaolveraDec 11, 2023Brass Contributor
- mtarlerDec 11, 2023Silver Contributor
jaolvera My guess is that the January don't match because 1 is 'text' and the other is 'date' (unless the values 1,2,3 are text but doubt that). Just because it shows "January" doesn't mean it is a 'text' value. See this image:
A12 is a 'text' value = "January" but A13 is a 'date' value being shown as the month text. Notice the formula bar above shows 1/1/2023 even though the cell shows "January".
If this isn't the problem please share the sheet for me to see what else it might be. (if you can't post here you can PM it to me)