Pls help Need to sum some "characters"

testy

New Member
Joined
Mar 13, 2015
Messages
2
Sorry, may be it's written somewhere but I didn't find... :(
I need to sum some letter but on each letter corresponds number. I can make it with vloookup, but there will be many vlookups, can you help me to make it better...
this sample table:

[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]d[/TD]
[TD="align: center"]d[/TD]
[TD="align: center"]n[/TD]
[TD="align: center"]n[/TD]
[TD="align: center"]h[/TD]
[TD="align: center"]p[/TD]
[TD="align: center"]p[/TD]
[/TR]
[TR]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]d[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]n[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]h[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]p[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]

so i wrote: =VLOOKUP(A1;C4:D7;2;0)+VLOOKUP(B1;C4:D7;2;0)+VLOOKUP(C1;C4:D7;2;0)+VLOOKUP(D1;C4:D7;2;0)+VLOOKUP(E1;C4:D7;2;0)+VLOOKUP(F1;C4:D7;2;0)+VLOOKUP(G1;C4:D7;2;0)
result is 8+8+12+12+14+0+0=54.
I hope it's clear what is the idea.
Thank you!
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Since your lookup table is small, you could use:

Code:
=COUNTIF(A1:G1,$d$4)*8+COUNTIF(A1:G1,$d$5)*12+COUNTIF(A1:G1,$d$6)*14
 
Upvote 0
This is a CSE formula that you must confirm with Ctrl+Shift+Enter, do not just hit the Enter key):
Code:
=SUM(COUNTIF(A1:G1,C4:C7)*(D4:D7))
 
Upvote 0
Super. I didn't expect such a short and clear solution. Thank you very match! It's working great, only we have to be careful not to have duplication in decoding (i.e. in c4:c7 not to have twice d), otherwise the result will be incorrect.
 
Upvote 0
Please clarify "not to have duplication in decoding (i.e. in c4:c7 not to have twice d), otherwise the result will be incorrect". Using my formula, if C7 is changed to d and D7 is changed to 2, the result becomes 58 - why isn't that correct?
 
Upvote 0

Forum statistics

Threads
1,223,268
Messages
6,171,100
Members
452,379
Latest member
IainTru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top