IF function in combination with an Round function Excel

0 votes

To round a certain value, I'm attempting to combine an IF function with a round function. In this instance, cell H2 contains the value. E2 = decimal places There are 9 decimal places if E2=9. I try to utilize this formula (which is only dependent on E2=0 and E2=1), but it does not work.

=IF( E2= 0,ROUND( $H2, 2),IF( E2=1 ,ROUND( $H2, 1))

I receive an error message, something in the syntax has to be fixed. Can someone please help me with this?

Sep 24, 2022 in Others by Kithuzzz
• 38,000 points
3,545 views

1 answer to this question.

0 votes

I'm not sure if it is a language setting, but I had to change every ',' to a ';'. Additionally, you overlooked a closing break.

=IF(E2=0;ROUND($H2;2);IF(E2=1;ROUND($H2;1)))

Besides this, I think that

=IFERROR(ROUND($H$2;E2); 0)

would be a better solution to use. Now you don't need the IF functions.

answered Sep 25, 2022 by narikkadan
• 63,600 points

Related Questions In Others

0 votes
1 answer

How to print an Excel Sheet using VBA with Nitro PDF Creator in Excel 2016

you can use the built-in excel facilities ...READ MORE

answered Sep 24, 2022 in Others by narikkadan
• 63,600 points
1,352 views
0 votes
1 answer

How Can I Round Prices to the nearest 0.95 with an Excel Formula?

Try this: =IF(OR(A3-FLOOR(A3,1)>0.95,A3=CEILING(A3,1)),CEILING ...READ MORE

answered Oct 9, 2022 in Others by narikkadan
• 63,600 points
702 views
0 votes
1 answer

How do I protect all worksheet in an Excel workbook with a single click?

VBA Code : Dim ws as Worksheet Dim pwd ...READ MORE

answered Oct 22, 2022 in Others by narikkadan
• 63,600 points
853 views
0 votes
1 answer

Help needed with Median If in Excel

Try entering the formula =MEDIAN(IF($A$1:$A$6="Airline",$B$1:$B$6,"")) in another ...READ MORE

answered Nov 10, 2022 in Others by narikkadan
• 63,600 points
900 views
0 votes
1 answer

Excel If field with rounding

Here's your formula. Assumes your cell containing ...READ MORE

answered Sep 27, 2022 in Others by narikkadan
• 63,600 points
821 views
0 votes
1 answer

Equivalent of Excel Round function

Here's a sample LINQPad program that demonstrates one way ...READ MORE

answered Sep 26, 2022 in Others by narikkadan
• 63,600 points
1,084 views
0 votes
1 answer

IF formula to compare a date with current date and return result

You can enter the following formula in ...READ MORE

answered Sep 27, 2022 in Others by narikkadan
• 63,600 points
1,024 views
0 votes
1 answer

Excel Formula - if values in columns all contain X then return

You can use the AND function: = IF(AND(A3="OK";B3="OK";C3="OK");"everything ...READ MORE

answered Nov 4, 2022 in Others by narikkadan
• 63,600 points
1,570 views
0 votes
1 answer

How to trick an Excel function that wants a column as input to accept a list of values as if these were in a column

Use VSTACK: vstack to make an array: Use it as value ...READ MORE

answered Mar 18, 2023 in Others by narikkadan
• 63,600 points
484 views
0 votes
1 answer

Excel AVERAGEIF function in combination with MOD to average over every nth row not behaving as expected

Average Every Nth Row All three finish in ...READ MORE

answered Mar 27, 2023 in Others by narikkadan
• 63,600 points
394 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP