Add the data

sksanjeev786

Well-known Member
Joined
Aug 5, 2020
Messages
831
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi Team,

Need to add from A2 to E2 output answer I have kept in G2

book2
ABCDEFG
1Total from A2 to E2
248%F36%16%EJ--100
328%36%14%GR5%6%CJR89
433%31%13%E6%HJ4%JR87
532%F33%18%G8%5%JR96
627%DI29%D10%6%6%R78
738%32%15%5%4%IJR94
839%F40%R14%GJ5%EJ1%J99
940%DFI36%15%E4%E3%EJR98
1035%DFI40%17%EJ5%CE2%J99
1120%FI30%21%R12%R8%CEJR91
1213%I22%CF21%13%13%D82
1328%F23%12%C7%J5%75
1419%I13%I6%4%9%G51
Sheet1


Regards,
Sanjeev
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
One way of doing it is copy/paste the following function code to a module:

VBA Code:
Function GetNumeric(CellRef As String)
'
    Dim StringLength As Integer
'
    StringLength = Len(CellRef)
'
    For i = 1 To StringLength
        If IsNumeric(Mid(CellRef, i, 1)) Then Result = Result & Mid(CellRef, i, 1)
    Next
'
    GetNumeric = Result
End Function

After that you can use Formulas on your sheet, for example to Add up A2 through E2 You would use the following formula:
= SUM(GetNumeric(A2), GetNumeric(B2), GetNumeric(C2), GetNumeric(D2), GetNumeric(E2))

You can then drag that formula down the column.
 
Upvote 0
You could also try with standard worksheet functions

21 12 12.xlsm
ABCDEFG
1Total from A2 to E2
248%F36%16%EJ--100
328%36%14%GR5%6%CJR89
433%31%13%E6%HJ4%JR87
532%F33%18%G8%5%JR96
627%DI29%D10%6%6%R78
738%32%15%5%4%IJR94
839%F40%R14%GJ5%EJ1%J99
940%DFI36%15%E4%E3%EJR98
1035%DFI40%17%EJ5%CE2%J99
1120%FI30%21%R12%R8%CEJR91
1213%I22%CF21%13%13%D82
1328%F23%12%C7%J5%75
1419%I13%I6%4%9%G51
Sum
Cell Formulas
RangeFormula
G2:G14G2=SUMPRODUCT(IFERROR(--LEFT(A2:E2,FIND("%",A2:E2&"%")),0))*100
 
Upvote 0
One way of doing it is copy/paste the following function code to a module:

VBA Code:
Function GetNumeric(CellRef As String)
'
    Dim StringLength As Integer
'
    StringLength = Len(CellRef)
'
    For i = 1 To StringLength
        If IsNumeric(Mid(CellRef, i, 1)) Then Result = Result & Mid(CellRef, i, 1)
    Next
'
    GetNumeric = Result
End Function

After that you can use Formulas on your sheet, for example to Add up A2 through E2 You would use the following formula:
= SUM(GetNumeric(A2), GetNumeric(B2), GetNumeric(C2), GetNumeric(D2), GetNumeric(E2))

You can then drag that formula down the column.


Thank you so much Johnn :) for your hard work!!!!
 
Upvote 0
You could also try with standard worksheet functions

21 12 12.xlsm
ABCDEFG
1Total from A2 to E2
248%F36%16%EJ--100
328%36%14%GR5%6%CJR89
433%31%13%E6%HJ4%JR87
532%F33%18%G8%5%JR96
627%DI29%D10%6%6%R78
738%32%15%5%4%IJR94
839%F40%R14%GJ5%EJ1%J99
940%DFI36%15%E4%E3%EJR98
1035%DFI40%17%EJ5%CE2%J99
1120%FI30%21%R12%R8%CEJR91
1213%I22%CF21%13%13%D82
1328%F23%12%C7%J5%75
1419%I13%I6%4%9%G51
Sum
Cell Formulas
RangeFormula
G2:G14G2=SUMPRODUCT(IFERROR(--LEFT(A2:E2,FIND("%",A2:E2&"%")),0))*100


Thank you So much Peter :):)

As mentioned earlier you always Rockkkkk!!!:)
 
Upvote 0

Forum statistics

Threads
1,203,081
Messages
6,053,416
Members
444,662
Latest member
AaronPMH

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