# Excel/VBA problem

If you're the first out the door, that's not called panicking

Share this

# Study together. Pass together.

Join the world's largest online community of CFA, CAIA and FRM candidates.

If you're the first out the door, that's not called panicking

Share this

Join the world's largest online community of CFA, CAIA and FRM candidates.

Studying With

Send me excel sheet

Not sure what you mean criteria *2018*, did you try year() function?

Studying With

Depends on what format the source data is in. If it’s a year, then “2018” would work as the search criteria. If the time data is in “MMDDYYYY” format, then you’ll need to create a separate column that converts that format to a simple 4 digit year using the YEAR function. This column will then be the criteria column for your SUMIF.

“2018” = exact match

“*2018*”= contains 2018

I was able to go around the issue with a SUMIFS, so that the function sums the values if dates are between Jan 1st and Dec 31st of 20XX.

If you're the first out the door, that's not called panicking

Studying With

When using the “*2018*” rule, does it have to read 2018? Or, can it be 8201 for example?

¯\_(ツ)_/¯ It be like that sometimes.

I believe it has to read 2018, but I’m not 100% sure.

If you're the first out the door, that's not called panicking

Studying With

Just use the “YEAR(date)” function within SUMIF.

Let excel work for you rather than you working for excel :)

Studying With

Hi.

You can also try formula SUMPRODUCT - very powerful one. But keep in mind, that it might make your file heavy if you apply it to a big number of cells/columns.

=SUMPRODUCT(–(YEAR($C$3:$C$19)=2018)*$D$3:$D$19)