[Solved] Adding cells that are only numbers

Discuss the spreadsheet application
Post Reply
PTReese
Posts: 2
Joined: Wed Apr 24, 2019 3:35 am

[Solved] Adding cells that are only numbers

Post by PTReese »

I'm trying to add cells together.
=B3+G3+L3+Q3+V3+B30+G30+L30+Q30+V30
Cells can be any mix of numbers or blanks.
If they are all blank they eval to 0. Is there a way to make them eval to nothing or blank?

Or is there a way to check to see if any one of the cells contains a number and add them together only then?

Not sure if that will make sense.. best way i can describe it.

Edit: Sometimes i need to manually enter a 0.. which i need treated like a 0. But the blanks evaluating to 0 confuses another formula i have.
Last edited by PTReese on Wed Apr 24, 2019 4:40 am, edited 3 times in total.
OpenOffice 4.1.6 on Windows 10
User avatar
MrProgrammer
Moderator
Posts: 4905
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Adding cells that are only numbers

Post by MrProgrammer »

Hi, and welcome to the forum.
PTReese wrote:=B3+G3+L3+Q3+V3+B30+G30+L30+Q30+V30
Or is there a way to check to see if any one of the cells contains a number and add them together only then?
=IF(COUNT(B3;G3;L3;Q3;V3;B30;G30;L30;Q30;V30);SUM(B3;G3;L3;Q3;V3;B30;G30;L30;Q30;V30);"")

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
PTReese
Posts: 2
Joined: Wed Apr 24, 2019 3:35 am

Re: Adding cells that are only numbers

Post by PTReese »

Love you!
OpenOffice 4.1.6 on Windows 10
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Adding cells that are only numbers

Post by RusselB »

Please note that Calc does not have a way of returning a true blank as the result of a formula. MrProgrammer's code uses the "", which is the closest that Calc gets to returning a blank.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Post Reply