smirnoff103
smirnoff103

Reputation: 328

Excel: count amount of characters

I have to calculate a price by single character. In my example I have 110 parts that are numbered, so this means I have:

Is there a way to calculate this with a (nested) formula ? I've been thinking about since a few days and can't come with a solid & modular formula. See "manual"-Excel calculation here below. Example Thanks for your help.

Upvotes: 0

Views: 58

Answers (2)

Qualia Communications
Qualia Communications

Reputation: 715

If you want to calculate the number of characters of a list of values that is not a continuous sequence starting with 1 up to e.g. 110, then you can do it with the following formula:

=SUM(COUNTIFS(list,">=1",list,"<=9")*1,COUNTIFS(list,">=10",list,"<=99")*2,COUNTIFS(list,">=100",list,"<=999")*3)

Note: the term "list" is just a name that refers to a range of Excel cells.

Upvotes: 0

JvdV
JvdV

Reputation: 75890

Do you mean:

=SUM(LEN(SEQUENCE(110)))

Or for non-Microsoft 365 versions:

=SUMPRODUCT(LEN(ROW(A1:INDEX(A:A,110))))

Upvotes: 2

Related Questions