0

In MS Excel, I'm trying to make a wildcard search using the SUMIF function. I'm following this guide. However, for some reason my Excel doesn't think the words in the range are equal to the criterion.

Suppose I have the following data: The data in A2:B6 I have apple as a criterion and want to find sum all the cells adjacent to one containing the word apple. My formula is: =sumif(A2:A6, "*apple*", B2:B6)

Now, for some reason the result of the sum function amounts to nothing.

I also tried another test, which I think my error has to do with. If I type = "apple" = "*apple*", Excel returns False`. The two are related, I think, but I don't see how I can solve my original problem.

Any help is much appreciated.

Sam
  • 305
  • 1
  • 8

1 Answers1

1

Try

=sumif(b2:b6,"*apple*",a2:a6)

As according to your example you have the sum range first followed by the range you are controlling against.

That is the wrong way round for sumif().

Solar Mike
  • 7,156
  • 4
  • 17
  • 32
  • Hi Mike, thanks for your help! However, I put it wrongly in my original request, but not in my Excel. My Excel formula's arguments were correct, but still it didn't work for some reason. I found the error: where my numbers were formatted with comma's as decimal mark, instead of dots. This made the formula add to zero. Thanks again for your help! – Sam Sep 27 '21 at 20:35