=SUMIF(A2:A4,"????Z*",C2:C4)

in the above formula I want to sum of the locations all having 4 digit text i.e. 1200, 2450, 3360, 7600, 4600

I tried following formula for locations who has 6 as its second digit but not working

=SUMIF(A2:A4,"?6??",C2:C4)

=SUMIF(A2:A4,"?6??",C2:C4) works for me as long the referenced cells contain 4 characters and is recognized as a text string. e.g. A624

A6bb

'1624 (The apostrophe forces the number to be a text string)However, I'm confused by your post. Are you asking 2 different questions or is your second formula somehow related to your first?

Your first formula works for value that have a

Zin the 5th position yet you say you want it to sum locations that contain 4 digit text strings. Why do you have the Z* in the formula?It might help if you posted an example of your data along with the expected results. That way we would know exactly what you are working with and exactly what the result should be.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Ask Your Question

Weekly Poll

Did you buy anything on Amazon's Prime Day?

Discuss in The Lounge

Poll History