Calculating Dollars not GBP in a row

piggylumps

Board Regular
Joined
May 11, 2011
Messages
55
Is there anyway I can calculate the sum of a certain currency in a row while ignoring others?

Say for example I have a range of a1:d1, a1 will be $25, b1 will be £36, c1 will be $75 and d1 will be £5.

So what I'm looking for will be a formula in e1 which tells it to sum the range only if the numbers are entered in $'s.

Hope that makes sense.
 
Last edited:
Do the Yen currency cells contain ¥ in the format? If so it should work, try it on a single cell not a range.
 
Upvote 0

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
I didn't have time to test yesterday but just tried your code and it works for me with yen.

I assume you're using japanese yen ¥, not chinese yuan ¥ (which it would seem doesn't work).
 
Upvote 0
Just reformatted the cells to different currencies and back to Yen again and for some reason it's decided to work properly now. Guess everything is entitled to having an off day. Thanks again
 
Upvote 0
Try this instead

Rich (BB code):
Public Function SUMCURR(rng As Range, curr As String) As Currency
Application.Volatile
Select Case curr
Case "USD"
curr = "$"
Case "EURO"
curr = "€"
Case "GBP"
curr = "£"
Case "YEN"
curr = "¥"
End Select
For Each cell In rng
If InStr(cell.Text, curr) Then
SUMCURR = SUMCURR + cell.Value
End If
Next
End Function
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,729
Members
452,939
Latest member
WCrawford

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