how to reduce a date TO A SINGLE DIGIT

zebra7860

Active Member
Joined
Jan 9, 2004
Messages
403
Hi,

I have dates in the following format ( MM/DD/YYYY) starting with cell D2:

ie 5/15/1997
ie 01/22/2018

I simply want to create a mod formula in cell E2 that summarizes the date value to a single digit, ie:

5+1+5+1+9+9+7 = 37 = 10 = 1+0 = 1
1+2+2+2+0+1+8 = 34 = 7

Can anybody help?

Thanks,
Al
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Are your dates real dates, or text?
 
Upvote 0
inelegant:
Excel Formula:
=INT((INT(SUM(VALUE(MID(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000"),ROW(INDIRECT("1:"&LEN(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000")))),1)))/10)+MOD(SUM(VALUE(MID(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000"),ROW(INDIRECT("1:"&LEN(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000")))),1))),10))/10)+MOD((INT(SUM(VALUE(MID(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000"),ROW(INDIRECT("1:"&LEN(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000")))),1)))/10)+MOD(SUM(VALUE(MID(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000"),ROW(INDIRECT("1:"&LEN(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000")))),1))),10)),10)
 
Upvote 0
Ok, how about
+Fluff 1.xlsm
AB
422/01/20187
513/10/19884
619/06/20145
725/07/20187
830/09/19948
927/10/19979
1004/02/20133
Main
Cell Formulas
RangeFormula
B4:B10B4=1+(TEXT(A4,"ddmmyyyy")-1)-(INT((TEXT(A4,"ddmmyyyy")-1)/9)*9)
 
Upvote 0
Hi,
Are you sure we can't have a MOD function? This is too long and when I used it by for date 05/15/1997 I get "0"
And I changed the 'p2' to D2 to reflect the date cell

Thanks for the offer
 
Upvote 0
I get a 1 when I do that. But use Fluff's. It is much simpler to use.
MrExcelPlayground2.xlsx
PQRSTUVW
25/15/1997051519970515199737101
Sheet26
Cell Formulas
RangeFormula
Q2Q2=TEXT(MONTH(P2),"00")
R2R2=TEXT(DAY(P2),"00")
S2S2=TEXT(YEAR(P2),"0000")
T2T2=TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000")
U2U2=SUM(VALUE(MID(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000"),ROW(INDIRECT("1:"&LEN(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000")))),1)))
V2V2=INT(SUM(VALUE(MID(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000"),ROW(INDIRECT("1:"&LEN(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000")))),1)))/10)+MOD(SUM(VALUE(MID(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000"),ROW(INDIRECT("1:"&LEN(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000")))),1))),10)
W2W2=INT((INT(SUM(VALUE(MID(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000"),ROW(INDIRECT("1:"&LEN(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000")))),1)))/10)+MOD(SUM(VALUE(MID(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000"),ROW(INDIRECT("1:"&LEN(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000")))),1))),10))/10)+MOD((INT(SUM(VALUE(MID(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000"),ROW(INDIRECT("1:"&LEN(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000")))),1)))/10)+MOD(SUM(VALUE(MID(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000"),ROW(INDIRECT("1:"&LEN(TEXT(MONTH(P2),"00")&TEXT(DAY(P2),"00")&TEXT(YEAR(P2),"0000")))),1))),10)),10)
 
Upvote 0
As you are just dealing with dates, you should be able to just use
Excel Formula:
=1+(MOD(TEXT(A4,"ddmmyyyy")-1,9))
 
Upvote 0
Hi Fluff,
I revamped your code to =1+(TEXT(D2,"mmddyyyy")-1)-(INT((TEXT(D2,"mmddyyyy")-1)/9)*9)
This reflects the fact that the beginning date is in cell D2, and I changed the ddmmyyyy to mmddyyyy but I still get " #VALUE!

Any thoughts?
 
Upvote 0
It doesn't matter what date format you use as you are just looking at the individual digits, so the order is irrelevant.
What does this return
Excel Formula:
=ISTEXT(D2)
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,462
Members
448,965
Latest member
grijken

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