Thanks:  0
Likes:  0

1. ## convert formula to code please

is there a way that I can convert this formula to code? it seems it is too long now and the last part of the formula does not work

=IF(B14="cedar conversion",ROUNDUP(B16/10,0),IF(B14="plywood over shiplap tear off",ROUNDUP(B16/10,0),IF(B14="2 layer plywood over shiplap",ROUNDUP(B16/10,0),IF(B14="3 layer plywood over shiplap",ROUNDUP(B16/10,0),IF(B14="1 layer on cedar tear off",ROUNDUP(B16/10,0),IF(B14="2 layer on cedar tear off",ROUNDUP(B16/10,0),IF(B14="3 layer on cedar tear off",ROUNDUP(B16/10,0),"")))))))

2. ## Re: convert formula to code please

Instead of nesting it, since all the conditions are resulting in the same calculation, why not use OR, i.e.
=IF(OR(condition1, condition2, condition3, ...),ROUNDUP(B16/10,0),"")

3. ## Re: convert formula to code please

Originally Posted by d0wnt0wn
is there a way that I can convert this formula to code? it seems it is too long now and the last part of the formula does not work

=IF(B14="cedar conversion",ROUNDUP(B16/10,0),IF(B14="plywood over shiplap tear off",ROUNDUP(B16/10,0),IF(B14="2 layer plywood over shiplap",ROUNDUP(B16/10,0),IF(B14="3 layer plywood over shiplap",ROUNDUP(B16/10,0),IF(B14="1 layer on cedar tear off",ROUNDUP(B16/10,0),IF(B14="2 layer on cedar tear off",ROUNDUP(B16/10,0),IF(B14="3 layer on cedar tear off",ROUNDUP(B16/10,0),"")))))))
How many conditions do you have where your don't round B16/10? It may be easier to write a formula when those conditions are not met....

4. ## Re: convert formula to code please

its about the same amount... let me try the 1f(or( way as suggested and I will report back

5. ## Re: convert formula to code please

Hi Joe it returns a #value error using that method

6. ## Re: convert formula to code please

Originally Posted by d0wnt0wn
Hi Joe it returns a #value error using that method
What is in B16 when you get the error?

7. ## Re: convert formula to code please

Hi Joe it returns a #value error using that method
Also, please post your formula attempt, as well as the values in B14 and B16.

8. ## Re: convert formula to code please

Hi Joe

Here is the formula I tried =IF(OR("Cedar conversion"),ROUNDUP(B16/10,0),"")

Cedar conversion is in cel B14

50 is in cel B16

9. ## Re: convert formula to code please

Also, there is no sense in using OR with only one condition. I assume you will be adding your other conditions, i.e.
=IF(OR(B14="Cedar conversion",B14="plywood over shiplap tear off",B14="2 layer plywood over shiplap",...),ROUNDUP(B16/10,0),"")

10. ## Re: convert formula to code please

oops... thanks

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•