I am trying to add more than one IF and cannot for love nor money,
One sheet called positions where i enter details of positions placed. i will
enter 1 in a cell i want it to be 150 in another, if i enter 2 i want it to
be 100 etc
Hope you can help,
k1ngy

Re: IF sum help by Ron

Ron
Sat Mar 15 16:12:49 CDT 2008

This structure works if there will only be a few alternatives:
=IF(A1=1,150,IF(A1=2,100,"not 1 or 2"))

Does that help?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"k1ngy" <k1ngy@discussions.microsoft.com> wrote in message
news:8605F9F4-FEB9-4E8B-81FB-630064942A6E@microsoft.com...
>I am trying to add more than one IF and cannot for love nor money,
> One sheet called positions where i enter details of positions placed. i
> will
> enter 1 in a cell i want it to be 150 in another, if i enter 2 i want it
> to
> be 100 etc
> Hope you can help,
> k1ngy
>




Re: IF sum help by cht13er

cht13er
Sat Mar 15 17:03:28 CDT 2008

On Mar 15, 5:12 pm, "Ron Coderre" <ronREMOVETHIScode...@bigfoot.com>
wrote:
> This structure works if there will only be a few alternatives:
> =IF(A1=1,150,IF(A1=2,100,"not 1 or 2"))
>
> Does that help?
> Post back if you have more questions.
> --------------------------
>
> Regards,
>
> Ron
> Microsoft MVP (Excel)
> (XL2003, Win XP)
>
> "k1ngy" <k1...@discussions.microsoft.com> wrote in message
>
> news:8605F9F4-FEB9-4E8B-81FB-630064942A6E@microsoft.com...
>
> >I am trying to add more than one IF and cannot for love nor money,
> > One sheet called positions where i enter details of positions placed. i
> > will
> > enter 1 in a cell i want it to be 150 in another, if i enter 2 i want it
> > to
> > be 100 etc
> > Hope you can help,
> > k1ngy


You can also use this format:

.....
Dim varCellValue As Variant
varCellValue = Cells(1, 1).Value

Select Case varCellValue
Case 1:
Cells(1, 2).Value = 150
Case 2:
Cells(1, 2).Value = 100
Case Is > 2:
Cells(1, 2).Value = "Hi"
End Select
......

It's a nice compact, easy-to-follow way to avoid a huge string of
nested IF statements (like below)

Nested IFs:

....
Dim varCellValue As Variant
varCellValue = Cells(1, 1).Value

If varCellValue = 1 then
cells(1,2).value = 150
elseif varCellValue =2 then
cells(1,2).value=100
else
cells(1,2).value = "Hi"
end if


HTH

Chris

Re: IF sum help by k1ngy

k1ngy
Sat Mar 15 23:04:00 CDT 2008

Thanks for replies,
I have 23 alternatives! will the below still work they are
1=150,2=100,3=80,4=70,5=60,6=50,7=40,8=30,9=20,10=10,11=0,12=0,13=0,14=0,15=0,16=0,17=0,18=0,19=0,20=0,21=0,22=0,DNF=0
Thanks,

"Ron Coderre" wrote:

> This structure works if there will only be a few alternatives:
> =IF(A1=1,150,IF(A1=2,100,"not 1 or 2"))
>
> Does that help?
> Post back if you have more questions.
> --------------------------
>
> Regards,
>
> Ron
> Microsoft MVP (Excel)
> (XL2003, Win XP)
>
> "k1ngy" <k1ngy@discussions.microsoft.com> wrote in message
> news:8605F9F4-FEB9-4E8B-81FB-630064942A6E@microsoft.com...
> >I am trying to add more than one IF and cannot for love nor money,
> > One sheet called positions where i enter details of positions placed. i
> > will
> > enter 1 in a cell i want it to be 150 in another, if i enter 2 i want it
> > to
> > be 100 etc
> > Hope you can help,
> > k1ngy
> >
>
>
>
>

Re: IF sum help by k1ngy

k1ngy
Sun Mar 16 02:31:01 CDT 2008

Thanks for your help i have done it now,
k1ngy

"k1ngy" wrote:

> Thanks for replies,
> I have 23 alternatives! will the below still work they are
> 1=150,2=100,3=80,4=70,5=60,6=50,7=40,8=30,9=20,10=10,11=0,12=0,13=0,14=0,15=0,16=0,17=0,18=0,19=0,20=0,21=0,22=0,DNF=0
> Thanks,
>
> "Ron Coderre" wrote:
>
> > This structure works if there will only be a few alternatives:
> > =IF(A1=1,150,IF(A1=2,100,"not 1 or 2"))
> >
> > Does that help?
> > Post back if you have more questions.
> > --------------------------
> >
> > Regards,
> >
> > Ron
> > Microsoft MVP (Excel)
> > (XL2003, Win XP)
> >
> > "k1ngy" <k1ngy@discussions.microsoft.com> wrote in message
> > news:8605F9F4-FEB9-4E8B-81FB-630064942A6E@microsoft.com...
> > >I am trying to add more than one IF and cannot for love nor money,
> > > One sheet called positions where i enter details of positions placed. i
> > > will
> > > enter 1 in a cell i want it to be 150 in another, if i enter 2 i want it
> > > to
> > > be 100 etc
> > > Hope you can help,
> > > k1ngy
> > >
> >
> >
> >
> >