Formula help Mod and square

  • Thread starter Thread starter Mifty
  • Start date Start date
M

Mifty

Hi everyone,

Is there any chance that some kind soul could tell me what these 2 formulae
are doing please?

F13 is a date

=(MOD(F13,10^6)-MOD(F13,10^4))/10000

=(MOD(F13,10^6)-MOD(F13,10^4))/10000+MOD(F13,10^4)*100

Thank you very much
 
Let's look at the first
Suppose F13 hole 12345678
MOD(F13,10^6) says divide F13 by 1 million and return the remainder: you get
345678
MOD(F13,10^4) says divide F13 by 10,000 and return the remainder; you get
5678
The we subtract to get 340000; then divide by 10,000 to get 34

In the second one we find MOD(F13,10^4) again = 5678
Multiply by 100: 567800

Then we add this to the first answer: 567834

Not sure why you would want this but that is what they do

best wishes
 
The first one
=(MOD(F13,10^6)-MOD(F13,10^4))/10000

divides the date by 10^6 or 1 million and gets the modulus (remainder)= 39541
or if converted to a date the same as in F13
divides the date by 10^4 or 1 thousand and gets the modulus (remainder) = 9541
it subtracts these 2 values and get 30000 and divides that by 10000 and gets
the answer of 3

I think from that you should be able to work our what the second one is
doing while I work out why!!

Mike
 
Thank you Bernard,

In a very befuddled way I'm trying to work out what they are trying to do
but it's just giving me a headache at the moment.

Maybe you or Mike would be able to work it out if I gave you the next one :-)

=IF(LEN(F13)=8,(IF(I13=1,-75.622,IF(J13 = 1, -24.226,0))),"")


F13 = date ddmmyyyy I13=IF(H13>(2004-2)*100+9,1,0)
J13 = =IF(H13>9+100*(2006-5),IF(G13<7,1,IF(G13>9,1,0)),0)

G13 = F13 as value
H13 = Lookup returning a value from 0-1

I think what they are trying to do is assign a value to date differences
through the year but there must be an easier way.

Could they have used datedif and then a lookup I wonder?

Do you think the 2 formulae using MOD were so that they could do
calculations with dates as Excel numbers and Years e.g. 2006 (J13)? Would it
not have been easier to use a specific date in 2006 and use the excel date to
do calcs?

Confused .......
 
Thanks Mike,

I've replied to Bernard, wondering if anyone could figure out what's going
on if you don't mind looking.

Cheers again
 
Hi Kevin,

Thank you for answering :-)

I've posted more to Bernard re what the spreadsheet is trying to do, if you
don't mind taking a look.

Many thanks
 
My guess is that F13 isn't actually a date in Excel terms, but a number like
25122008 being used to represent a date.
 
If F3 is a date in the form 12282008 or 1012008 etc then
=DATE(MOD(F13,10000),F13/10^6,MOD(INT(F13/10000),100))
will return a true date value
best wishes
 
Hi David,
Yep! just so

Many thanks

--
Mifty


David Biddulph said:
My guess is that F13 isn't actually a date in Excel terms, but a number like
25122008 being used to represent a date.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top