enter a numeric value and date in a cell.

shaju

Board Regular
Joined
Jul 12, 2004
Messages
80
Office Version
  1. 2010
Platform
  1. Windows
Is it possible that I can enter a numeric value and a date in the same cell, but only the numeric value is taken for calculations.
say, Cell A1 has "100", and Cell B1 has 25 - 03-09-17 in it . What I need in cell C1 is 100-25 = 75. (the result 75 only). 25 is the sale done on 03-09-17, and now I am entering the date in the comment box. does somebody know some way or format so that only a part of values entered into a cell is used for calculations. Even new idea to enter a value and date in the same cell might help me (as long as the answer to my question given above is 75)
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
will the number always be followed by a -
if so
=LEFT(B1,SEARCH("-",B1,1)-1)*1
Will give you the number

=A1 - (LEFT(B1,SEARCH("-",B1,1)-1)*1)
 
Upvote 0
Thank You etaf for the quick response. I should have made it clear.....Sorry for troubling with only a part of the question. The problem is that the cells which I need to have numeric value and date is not just one cell, it is a range from B1:k1. I should have made this clear. So the formula in cell L1 runs like this. "=A1- sum(b1:k1)". now the question is full.
 
Upvote 0
ok, so thats going to be a lot more difficult
an array may work

=SUMPRODUCT(1*LEFT(B1:K1,FIND("-",B1,1)-1))

OR
IF NOT ALL CELLS have values
=SUMPRODUCT(IF(ISNUMBER(VALUE(LEFT(b1:k1,FIND("-",b1,1)-1))),1*LEFT(b1:k1,FIND("-",b1,1)-1),0))

use
control + shift + enter to get an array
{
=SUMPRODUCT(IF(ISNUMBER(VALUE(LEFT(b1:k1,FIND("-",b1,1)-1))),1*LEFT(b1:k1,FIND("-",b1,1)-1),0))}
 
Last edited:
Upvote 0
ok, so thats going to be a lot more difficult an array may work

=SUMPRODUCT(1*LEFT(B1:K1,FIND("-",B1:K1,1)-1))

You need the part I show in red in case the first number has less digits in it than the number in cell B1.



OR
IF NOT ALL CELLS have values
=SUMPRODUCT(IF(ISNUMBER(VALUE(LEFT(b1:k1,FIND("-",b1,1)-1))),1*LEFT(b1:k1,FIND("-",b1,1)-1),0))

use
control + shift + enter to get an array
{
=SUMPRODUCT(IF(ISNUMBER(VALUE(LEFT(b1:k1,FIND("-",b1,1)-1))),1*LEFT(b1:k1,FIND("-",b1,1)-1),0))}
I think this shorter, normally-entered formula will also work...

=SUMPRODUCT(0+LEFT(B1:K1&0,FIND("-",B1:K1&"0-")-1))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,818
Members
449,049
Latest member
cybersurfer5000

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