简体   繁体   中英

Excel: count numbers greater than 3 in strings in range of cells

I have a spreadsheet tracking games of fifa 15 between me and my friend. We track goal scorers for each game in this format

Messi(2), Neymar, Suarez(4)

Goal scorers are recorded every game My goal is to count the number of hattricks scored total. In this particular game Suarez scored a hattrick since he score more than 3 goals. I am looking for a formula, any help is welcome. Thank you

Well if the cells are formatted exactly as shown, you could try:-

=SUM(LEN(A2:A4)-LEN(SUBSTITUTE(A2:A4,{"(3)","(4)","(5)","(6)"},"")))/3

where you would need to adjust the range A2:A4 to suit your data.

This assumes that even Messi is unlikely to score more than 6 goals in one match and if he did score 6 goals it would still count as one hat-trick.

It has to be entered as an array formula using Ctrl Shift Enter

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM