Results 1 to 2 of 2
  1. #1
    kentck86 is offline Novice
    Windows 8 Access 2007
    Join Date
    Jun 2015
    Posts
    13

    Excel formula QUOTIENT,INDIRECT in access

    Hi Guys,



    I have this long conversion works in excel, but as i have a huge dynamic database in access. Please advises how can this works the same in microsoft access for this case would be much appreciated.Sample.zip

    F2=RIGHT(DEC2BIN(MOD(QUOTIENT(C2,256^4),256),8),4) &DEC2BIN(MOD(QUOTIENT(C2,256^3),256),8)&DEC2BIN(MO D(QUOTIENT(C2,256^2),256),8)&DEC2BIN(MOD(QUOTIENT( C2,256^1),256),8)&DEC2BIN(MOD(QUOTIENT(C2,256^0),2 56),8)

    B2=SUMPRODUCT(--MID(E2,LEN(E2)+1-ROW(INDIRECT("1:"&LEN(E2))),1),(2^(ROW(INDIRECT("1 :"&LEN(E2)))-1)))
    A2=SUMPRODUCT(--MID(D2,LEN(D2)+1-ROW(INDIRECT("1:"&LEN(D2))),1),(2^(ROW(INDIRECT("1 :"&LEN(D2)))-1)))



    Thank you

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Access does not have intrinsic function to convert decimal to binary. Means writing VBA to create custom function. https://www.devhut.net/2010/06/22/vb...al-and-binary/

    Int() will do what Quotient() does.

    SumProduct() would be a Sum(this * this) in an aggregate query or in textbox on form or report.

    Instead of Indirect() refer to field that has value.

    Mid, Len, Left, Right are available in Access but Right and Left don't allow for a range for start and stop position - use Mid.

    Mod syntax is different.

    Here is an example using your data in Access query:

    SELECT nrCellIdentity, Right(Dec2Bin(Int([nrCellIdentity]/256^4) Mod 256,8),4) AS Bin FROM Sample;

    Since your formula for column F will be quite long, should probably build another VBA custom function for this calc.

    Last edited by June7; 07-22-2020 at 02:48 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Excel formula to access vba.
    By tonycl69 in forum Programming
    Replies: 2
    Last Post: 10-20-2016, 06:36 AM
  2. Excel formula to Access
    By JimO in forum Access
    Replies: 2
    Last Post: 03-05-2016, 04:48 PM
  3. Replies: 19
    Last Post: 07-13-2015, 10:15 AM
  4. Replies: 41
    Last Post: 05-29-2015, 02:58 PM
  5. set excel formula from access vba
    By trevor40 in forum Programming
    Replies: 16
    Last Post: 11-26-2014, 07:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums