# I want to tally a column but dependent on the text in the next column



## Tristram_ZX81 (Dec 14, 2022)

Hello. I'm using Office 365. I want to type a formula into the cells in the table below (columns M-S) that would tally how many occurrences there are of the D, M and N letters in the I column for each day of the week. So Monday should read

   Mon 
D 0
M 4 
M 1 

Tuesday should read

   Tue 
D 3 
M 1 
N 2 

And so on. Please can someone advise?


----------



## etaf (Dec 14, 2022)

can you change the table to use the same full day name - ????

if so then a simple countifs()
otherwise a sumproduct - see below

Book5HIJKLMNOP345mMondayMondayTuesdayWednesdayThursday6mMondayD03107nMondayM41208mMondayN12309mMonday10mTuesday11nTuesday12nTuesday13dTuesday14dTuesday15dTuesday16dwednesday17nwednesday18nwednesday19nwednesday20mwednesday21mwednesdaySheet1Cell FormulasRangeFormulaM6:P8M6=COUNTIFS($J$5:$J$21,M$5,$I$5:$I$21,$L6)


Book5HIJKLMNOPQ345mMondayMonTueWedThu6mMondayD03107nMondayM41208mMondayN12309mMonday10mTuesday11nTuesday12nTuesday13dTuesday14dTuesday15dTuesday16dwednesday17nwednesday18nwednesday19nwednesday20mwednesday21mwednesday22Sheet1Cell FormulasRangeFormulaM6:P8M6=SUMPRODUCT(  (LEFT($J$5:$J$21,3)=M$5)*($I$5:$I$21=$L6) )


----------



## Tristram_ZX81 (Dec 20, 2022)

Thanks Etaf. For some reason I can't get that formula to work in my document, as per the screen grab below: 

*

*


----------



## Fluff (Dec 20, 2022)

Try using the countifs formula that etaf posted.


----------



## Tristram_ZX81 (Dec 21, 2022)

Missed that one. Work snow. Thanks Etaf, thanks Fluff.


----------



## etaf (Dec 21, 2022)

you are welcome


----------

