Solved

All around round

Posted on 2014-03-27
2
236 Views
Last Modified: 2014-03-27
Hi All,

Sorry, couldn't resist the play on words today for this question.  :)

This is an extension of my previous question entitled "What is the equivalent?"

I will put that whole question here again and then ask the "All around round" portion of today's question.


Question: What is the equivalent?

"Hi All,

Suppose we have the following script:

(1)     "= if(constants!AO" & i & ">constants!AM" & i & ", 1, 0)"

which of course, in lay terms, is just putting in the formula

(2)      =if((constantsAO + row))>(constantsAM + row), then 1, else 0))

how would I do the reverse to get this starting with, in lay man terms:

(2)       = Round((constantsAO + row), AP),

      ....where in the column AP there is the corresponding list of significant digits, relevant to the correct row.

Wondering how to get this back into form (1).

(1) = ?

Is there also a way to get it into this form as well?

(1b) = constants.cells(i, "AO").formula?          {I know I butchered that, pls be kind}."


Nutsch gave the answer of:  "= Round(constants!AO" & i & ",constants!AP" & i & ")"


All around round:

Is there a way for VBA to "detect" how many significant digits there are in a number and automatically truncate the last digit and simply round up or down and incorporate that into (1) as above?   In other words, is there a way of not having the "Constants!AP & i" from Nutsch's answer?

I need this to work down a whole column so I will be needing this business of:

constants!AO" & i

Does that make sense?

thanks!
0
Comment
Question by:BostonBob
2 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 39960720
"=Round(constants!AO" & i & ",constants!AP" & i & ")"



for auto rounding try
"=Round(constants!AO" & i & ",log(constants!AO" & i & ")+1)"

you can increase or decrease the +1 to vary the number of significant figures.
0
 

Author Comment

by:BostonBob
ID: 39960729
How cool!  I'll try that. Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now