View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default Formula result based on Multiple IFs

If you are using Excel 2003 or earlier then you will be limited to 7
nested functions in a formula, so you might have come up against this
limit. One way around this is to set up a table of your variables and
the outcome and to use VLOOKUP, but it depends what your formula1,
formula2 etc look like as to whether you can use this approach. You
can string a number of IFs together like this:

=IF(I1="a",formula1,"")&IF(I1="b",formula2,"")&IF( I1="c",formula3,"")

and so on. This does not suffer from the limit as the functions are
not nested, but again it will not work in all cases. If your formulae
return numbers then it will have to be written as:

=IF(I1="a",formula1,0)+IF(I1="b",formula2,0)+IF(I1 ="c",formula3,0)

so that you are adding zero to the formula in those cases where the
criterion is not met. However, if you have a lot of conditions the
formula will be very long and difficult to maintain.

One other approach is to use a UDF to evaluate a string as if it were
a formula, and to build up that string depending on your criteria.
Perhaps if you could post a few more details of exactly what you want
to do ... ?

Hope this helps.

Pete

On Jun 23, 4:41*pm, Neil M wrote:
I have a spreadhseet where I need to have a formula based on any one of
several possible criterium. THis is for calculating the amount of reinforcing
steel in a wall slab or footing by linear feet and then over to tons.

Cell E1 is a named list (type1) that gives 3 possibles Wall, Slab or Footing

Cell I1 lets me choose the configuration (each way top, each way bottom,
each way vertical, each way horizontal, top, bottom, each face, each way each
face)

What I want is as follows:
IF I1 = a then formula 1
IF I1 =b then formula 2
IF I1 = c then formula 3

etc etc.
However I need all the poosible formulas to be entered

I have been trying to use a combination of IF as well as AND, but I cannot
get it to work.