How to sum columns only intregral numbers despite that have rows with text, decimals and percentual values?

Lacan

Board Regular
Joined
Oct 5, 2016
Messages
199
Office Version
  1. 365
Platform
  1. Windows
Hello Guys,
Hope you are OK!

Have 2 largest columns however in the example below that are only a sample
How to sum columns only intregral numbers despite that have rows with text, decimals and percentual values?
Thanks for all the help!!! 👍👍

Painel FARMÁCIAS_21.JUL.xlsx
ABCDEFGHI
1
2
3SALES ASALES B
4PYG MTH %Var MS (p.p.) PY MTH
5-3%-0,18
6OBJECTIVO1 100
71 000
8-0,55
910%500
101 869GOAL
11498
12TOTALTOTAL
13
14
15
Folha1
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
What would the expected result be? Or what are you trying to add up? 1000 in the first column? and 1100 and 500 in the second?
Because the other values have decimals.
SALES ASALES B
PYG MTH %Var MS (p.p.) PY MTH
-0.031431276-0.178044149
OBJECTIVO1100
1000
-0.55
0.1500
1869.164GOAL
497.9523
TOTALTOTAL
 
Upvote 0
Is this what you're looking for?

Book1
CDEFG
3SALES ASALES B
4PYG MTH %Var MS (p.p.) PY MTH
5-3%-18%
6OBJECTIVO1100
71000
8-0.55
910%500
101869.164GOAL
11497.9523
12TOTAL3367.116TOTAL1600
Sheet1
Cell Formulas
RangeFormula
D12,G12D12=SUMIF(D5:D11,">="&1)
 
Upvote 0
Dear @felixstraube and @Asbestos_Jen 👍

Thank you very much for the help.
To clarify even better would like for each one, "Column D" Sum from range D3:D11 and in "Column G" Sum from range G3:G11.

@Asbestos_Jen thats correct the results expected of both sums, however after test the formula just notice that the total amount still changes when other values decimal and percentual changes.
All the help is appreciated.
Thank you very much!👍👍


Painel FARMÁCIAS_21.JUL.xlsx
ABCDEFGHIJKL
1
2
3SALES ASALES B
4PYG MTH %Var MS (p.p.) PY MTH
5-3%-0,18
6OBJECTIVO1 100
71 000
8-0,55
910%500
101 869GOAL
11498
12TOTAL3367<= Expected ResultsTOTAL1600<= Expected Results
13
14
15
16
Folha1
 
Upvote 0
Are the green cells calculated by a formula, or are they entered manually?
If they are calculated, you could round them in those formulas. I've put helper columns in E and H to round the values before summing them in row 12.

2024-08-15.xlsm
CDEFGH
3SALES ASALES B
4PYG MTH %Var MS (p.p.) PY MTH
5-3%no-18%no
6OBJECTIVO#VALUE!11001100
710001000no
8no-0.55no
910%no500500
101869.1641869GOAL#VALUE!
11497.9523498no
12TOTAL3367.1163367TOTAL16001600
Sheet1
Cell Formulas
RangeFormula
H5:H12,E5:E12E5=IF(D5>=1,ROUND(D5,0),"no")
D12,G12D12=SUMIF(D5:D11,">="&1)
 
Upvote 0
So you want to sum all the integer values? without decimals?
You shared this in post #4 without showing the decimals:

SALES A
PYG MTH %
-0.031431276
OBJECTIVO
1000
0.1
1869.164
497.9523
3367.1163<= Expected Results


What would be the condition to add a number? That is greater than 1? Or you want to sum the integer part of each number after truncating it?
Do you want the decimal part to be summed up and in the end result?

Here are some options, which one would be better?:

Book1
ABCDEFGH
1
2
3SALES AGreater than 1TruncatedRounddownRound
4PYG MTH %
5-0.0314312760000
6OBJECTIVO0000
710001000100010001000
80000
90.10000
101869.1641869.164186918691869
11497.9523497.9523497497498
12TOTAL3367.11633367.1163336633663367
Sheet2
Cell Formulas
RangeFormula
E5:E11E5=(N(D5)>1)*N(D5)
F5:F11F5=TRUNC(N(D5), 0)
G5:G11G5=ROUNDDOWN(N(D5), 0)
H5:H12H5=ROUND(N(D5), 0)
E12:G12E12=SUM(E5:E11)
 
Upvote 0
So you want to sum all the integer values? without decimals?
You shared this in post #4 without showing the decimals:

SALES A
PYG MTH %
-0.031431276
OBJECTIVO
1000
0.1
1869.164
497.9523
3367.1163<= Expected Results


What would be the condition to add a number? That is greater than 1? Or you want to sum the integer part of each number after truncating it?
Do you want the decimal part to be summed up and in the end result?

Here are some options, which one would be better?:

Book1
ABCDEFGH
1
2
3SALES AGreater than 1TruncatedRounddownRound
4PYG MTH %
5-0.0314312760000
6OBJECTIVO0000
710001000100010001000
80000
90.10000
101869.1641869.164186918691869
11497.9523497.9523497497498
12TOTAL3367.11633367.1163336633663367
Sheet2
Cell Formulas
RangeFormula
E5:E11E5=(N(D5)>1)*N(D5)
F5:F11F5=TRUNC(N(D5), 0)
G5:G11G5=ROUNDDOWN(N(D5), 0)
H5:H12H5=ROUND(N(D5), 0)
E12:G12E12=SUM(E5:E11)


Dear @Asbestos_Jen & @felixstraube

Thank you very much Guys.
To clarify even better.
As said initially the table showned is just a simple sample. In my original table column has more then 400 rows.
Thus would like to have a formula that covers all this range through text cells to sum all the integer values without decimals values (negative or positive) and without percentual values (negative or positive).
Think it's even clearer now.
Hope you could help, Thank you very much! 👍👍🍻
*Sample attached

Painel FARMÁCIAS_21.JUL.xlsx
ABCDEFG
1
2
3SALES A
4PYG MTH %
5-3%
6OBJECTIVO
71 000
8-0,68
910%
101 869
11498
12TOTAL3367<= Expected Results
13
14
Folha1 (2)
 
Upvote 0
I still have questions.
When you share your table in post #7, you show again only the integer part but the cells have this values stored:
Book1
ABCDE
1
2
3SALES A
4PYG MTH %
5-0.03143128
6OBJECTIVO
71000
8-0.6789
90.1
101869.164
11497.9523
12TOTAL3367.1163<= Expected Results
Sheet1


When you say you want to add the integer parts, what do you mean? For example for these 2 values:

Original ValueTrucatedRounded
1869.16418691869
497.9523497498


And also the expected result you share has decimals. From your post I understood that you don't want them.
Can you clarify?
 
Upvote 0
I still have questions.
When you share your table in post #7, you show again only the integer part but the cells have this values stored:
Book1
ABCDE
1
2
3SALES A
4PYG MTH %
5-0.03143128
6OBJECTIVO
71000
8-0.6789
90.1
101869.164
11497.9523
12TOTAL3367.1163<= Expected Results
Sheet1


When you say you want to add the integer parts, what do you mean? For example for these 2 values:

Original ValueTrucatedRounded
1869.16418691869
497.9523497498


And also the expected result you share has decimals. From your post I understood that you don't want them.
Can you clarify?

Sorry @felixstraube

For family reasons have been away from my PC.
Now back, just made a small changes in table and data to make it clear even more.
As said initially the table showned is just a simple sample. In my original table column has more then 400 rows.
Would like to have a formula that covers all this range through text cells to sum all only the integer values without decimals values (negative or positive) and without percentual values (negative or positive).
Hope you could help.
Again, thank you very much! 👍👍🍻

Fórmula Principal para o Ficheiro VDF.xlsm
ABCDEFG
1
2
3SALES A
4PYG MTH %
5-3,143%
6OBJECTIVO
71000
8-0,6789
910%
101000
110,39
127000%
131000
14TOTAL3000<= Expected Results
15
16
25-08-2024
 
Upvote 0
I think that you would need vba to do that since the cell that shows as 7000% actually just contains the integral number 70 and the % sign only appears due to the cell formatting, not due to the underlying number. Is vba acceptable?
 
Upvote 0

Forum statistics

Threads
1,221,501
Messages
6,160,177
Members
451,629
Latest member
MNexcelguy19

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