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:
I'm thinking the same to be honest with you as I've now changed all the currencies to the correct ones and all I'm now showing is #NAME? in every single totals cell. Time to play with some macro security, wish me luck as macros aren't my strong suit, as you've propbaly guessed by now
 
Upvote 0

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Changed and rechanged the security settings but I'm still getting the annoying #NAME? return, completely at a loss now
 
Upvote 0
This should tell us if the code is being permitted to run.

Open the code editor, then on the left of the window, find and double click "ThisWorkbook"

Copy this code into the editor

Code:
Private Sub Workbook_Open()
MsgBox "Macros are enabled"
End Sub

Close the editor, then save and close your workbook.

When you re-open the workbook you should see either a message "macros are enabled" or a prompt to enable them.

Does that cure the #NAME? error?
 
Upvote 0
My man you're an absolute star. All cured. Thank you so much for all your help and patience, it's greatly appreciated<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
 
Upvote 0
Trying to add an extra column to calculate YEN but it's not seeing the values I've inputted. I've changed the code to show:

Public Function SUMCURR(rng As Range, curr As String) As Currency
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

but it's returning a zero value.

I'll be so glad when I can put this spreadsheet to bed once and for all
 
Upvote 0
I've just done a =CELL("FORMAT", ) on a cell that contains a Yen value and I'm getting a ,2 returned instead of ,0- which is what I'm looking for, anyone know how I can correct this?
 
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