Depending on the value range supplied, I want to build up an excel sheet that rounds the value to various decimal places. I experimented with many formulations but was unsuccessful. The need is shown in the image. Can you accomplish it using nested IF? or would something like a VB script be required? Please give me an example of an if formula that I can use for at least two ranges so that I can put it up for the others.

Nov 17, 2022 in Others 413 views

## 1 answer to this question.

Where the range is multiple cells:

```Excel.Worksheet sheet = workbook.ActiveSheet;
Excel.Range rng = (Excel.Range) sheet.get_Range(sheet.Cells[1, 1], sheet.Cells[3,3]);
```

Where range is one cell:

```Excel.Worksheet sheet = workbook.ActiveSheet;
Excel.Range rng = (Excel.Range) sheet.Cells[1, 1];```
answered Nov 17, 2022 by
• 63,420 points

## Is it possible to open developer tools console in Chrome on Android phone?

Is it possible to open JS console ...READ MORE

## Is it possible to see more than 65536 rows in Excel 2007?

Here is an interesting blog entry about the ...READ MORE

## Is it possible to get data from a webpage in real-time to an excel file?

The conventional method of obtaining data from ...READ MORE

## Trying to run different macros based on value of cell in a range

This demonstrates one approach to loop through ...READ MORE

## Calculate Birthdate from an age using y,m,d in Excel

Hello, yes u can find your birthdate using ...READ MORE

## Calculate Birthdate from an age using y,m,d in Excel

Hi To Calculate the date, we can ...READ MORE

## Convert Rows to Columns with values in Excel using custom format

1 I having a Excel sheet with 1 ...READ MORE

## IF - ELSE IF - ELSE Structure in Excel

In this case, you can use nested ...READ MORE