How to add a range of Values in a single cell

BigDaddyRod

New Member
Joined
Nov 21, 2018
Messages
4
Hello.

I came up across a problem: I want to add a range of values in a single cell but cannot seem to find a solution for this.
For example:

In cell A1 I want to write 1-12 and in cell B1 I want to write 25-28.
A1 B1
2-13 25-28


Now, I need the answer to A1 to be 12 and the answer to B1 to be 4, so the total value of both cells be 16.

How can I do this?
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Sorry, I tried to edit the thread but I do cannot seem to find the EDIT function, let me rephrase what I wanted:

In cell A1 I want to write 2-13 and in cell B1 I want to write 25-28.
A1 - B1
2-13 - 25-28


Now, what I need is that the answer to A1 be 12 (the range of numbers between 2 and 13) and the answer to B1 be 4 (range between 25-28), so the final sum of the 2 cells be 12+4 = 16.

Is there a way to do this?
 
Upvote 0
Hi & welcome to MrExcel
A cell can EITHER contain a value OR a formula, but not both.
You will either need to use another cell, or VBA.
 
Last edited:
Upvote 0
Oh, I see.
Then how can I add a range of numbers in a single cell like I showed before?

A1
2-13

The sum must be 12.
 
Upvote 0
In A2 put
=ABS(LEFT(A1,FIND("-",A1)-1)-RIGHT(A1,LEN(A1)-FIND("-",A1)))+1
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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