Add right most value ONLY if a number

bordensize

Board Regular
Joined
Dec 4, 2013
Messages
81
Office Version
  1. 365
Platform
  1. Windows
Good afternoon,
I'm trying to come up with a formula to only add the right most value of an array or cells if the values are numbers (and these numbers will only ever be 1, 2, or 3.) I've managed to come up with making sure all values are computed as numbers, but I cannot figure out how to ignore actual text values from the array to compute the way I need it to.

=SUMPRODUCT(IF((A1:A8)<>0,--RIGHT(A1:A8)))
This formula works if the column doesn't include any values ending with text (such as '2p' below,) but my column will almost always have multiple cells with values that end in text that I'd like to ignore.

Thoughts?

VBA Code:
1   
2   
3   
p1   
p2   
wjp1   
flf2   
2p   
    
#VALUE!    Sum
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

How about
Excel Formula:
=SUMPRODUCT(IFERROR(--RIGHT(A1:A8),0))
 
Upvote 0
Solution
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

How about
Excel Formula:
=SUMPRODUCT(IFERROR(--RIGHT(A1:A8),0))
I updated my info. Excel 365.

Also, yes that formula worked. Now I'm irritated that it was that simple.... Much appreciated!
 
Upvote 0

Forum statistics

Threads
1,216,074
Messages
6,128,652
Members
449,462
Latest member
Chislobog

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