PC Review Forums Newsgroups Microsoft Excel Microsoft Excel Discussion If statements

Reply

If statements

 
Thread Tools Rate Thread
Old 09-07-2008, 06:49 PM   #1
Mark.M.Sweeney@gmail.com
Guest
 
Posts: n/a
Default If statements


I want an IF statement that would be able to do the following:

IF cell A6 is between 1 and 4 then put "A" in cell A7
IF cell A6 is between 5 and 8 then put "B" in cell A7
IF cell A6 is between 9 and 12 then put "C" in cell A7
IF cell A6 is between 13 and 16 then put "D" in cell A7
IF cell A6 is between 17 and 20 then put "E" in cell A7


Any idea how I could do this?

Thank you in advance, Mark
  Reply With Quote
Old 09-07-2008, 07:10 PM   #2
compass rose
Junior Member
 
Join Date: Jul 2008
Posts: 3
Trader Rating: (0)
Default

You could try this:

=IF(A6<=4,"A",IF(A6<=8,"B",IF(A6<=12,"C",IF(A6<=16,"D","E"))))

Hope this helps,
David
compass rose is offline   Reply With Quote
Old 09-07-2008, 07:29 PM   #3
Don Guillett
Guest
 
Posts: n/a
Default Re: If statements

One way
=CHAR(LOOKUP(D55,{1,5,9,13,17},{65,66,67,68,69}))
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
<Mark.M.Sweeney@gmail.com> wrote in message
news:c920c6c4-2555-4135-8318-32beace0769e@s50g2000hsb.googlegroups.com...
>I want an IF statement that would be able to do the following:
>
> IF cell A6 is between 1 and 4 then put "A" in cell A7
> IF cell A6 is between 5 and 8 then put "B" in cell A7
> IF cell A6 is between 9 and 12 then put "C" in cell A7
> IF cell A6 is between 13 and 16 then put "D" in cell A7
> IF cell A6 is between 17 and 20 then put "E" in cell A7
>
>
> Any idea how I could do this?
>
> Thank you in advance, Mark


  Reply With Quote
Old 09-07-2008, 07:58 PM   #4
Dave Mills
Guest
 
Posts: n/a
Default Re: If statements

I would use LOOKUP and set up a lookup table in the sheet or array.

On Wed, 9 Jul 2008 09:49:12 -0700 (PDT), "Mark.M.Sweeney@gmail.com"
<Mark.M.Sweeney@gmail.com> wrote:

>I want an IF statement that would be able to do the following:
>
>IF cell A6 is between 1 and 4 then put "A" in cell A7
>IF cell A6 is between 5 and 8 then put "B" in cell A7
>IF cell A6 is between 9 and 12 then put "C" in cell A7
>IF cell A6 is between 13 and 16 then put "D" in cell A7
>IF cell A6 is between 17 and 20 then put "E" in cell A7
>
>
>Any idea how I could do this?
>
>Thank you in advance, Mark

--
Dave Mills
There are 10 type of people, those that understand binary and those that don't.
  Reply With Quote
Old 09-07-2008, 09:13 PM   #5
Gord Dibben
Guest
 
Posts: n/a
Default Re: If statements

I assume you mean 1 and 4, not between 1 and 4

=LOOKUP(A6,{1,5,9,13,17,21},{"A","B","C","D","E","over20"})


Gord Dibben MS Excel MVP

On Wed, 9 Jul 2008 09:49:12 -0700 (PDT), "Mark.M.Sweeney@gmail.com"
<Mark.M.Sweeney@gmail.com> wrote:

>I want an IF statement that would be able to do the following:
>
>IF cell A6 is between 1 and 4 then put "A" in cell A7
>IF cell A6 is between 5 and 8 then put "B" in cell A7
>IF cell A6 is between 9 and 12 then put "C" in cell A7
>IF cell A6 is between 13 and 16 then put "D" in cell A7
>IF cell A6 is between 17 and 20 then put "E" in cell A7
>
>
>Any idea how I could do this?
>
>Thank you in advance, Mark


  Reply With Quote
Old 09-07-2008, 09:35 PM   #6
Mark.M.Sweeney@gmail.com
Guest
 
Posts: n/a
Default Re: If statements

On Jul 9, 1:29*pm, "Don Guillett" <dguille...@austin.rr.com> wrote:
> One way
> =CHAR(LOOKUP(D55,{1,5,9,13,17},{65,66,67,68,69}))
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> dguille...@austin.rr.com<Mark.M.Swee...@gmail.com> wrote in message
>
> news:c920c6c4-2555-4135-8318-32beace0769e@s50g2000hsb.googlegroups.com...
>
>
>
> >I want an IF statement that would be able to do the following:

>
> > IF cell A6 is between 1 and 4 then put "A" in cell A7
> > IF cell A6 is between 5 and 8 then put "B" in cell A7
> > IF cell A6 is between 9 and 12 then put "C" in cell A7
> > IF cell A6 is between 13 and 16 then put "D" in cell A7
> > IF cell A6 is between 17 and 20 then put "E" in cell A7

>
> > Any idea how I could do this?

>
> > Thank you in advance, Mark- Hide quoted text -

>
> - Show quoted text -


Thank you, I put it together without the =CHAR part and it worked
fine. I don't know what the =CHAR part does, would it help?
  Reply With Quote
Old 09-07-2008, 10:16 PM   #7
Don Guillett
Guest
 
Posts: n/a
Default Re: If statements

char(65) is a capital A
Look in the help index for CHAR

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
<Mark.M.Sweeney@gmail.com> wrote in message
news:771ba175-7a44-4552-8523-fbc2b35abfea@r66g2000hsg.googlegroups.com...
On Jul 9, 1:29 pm, "Don Guillett" <dguille...@austin.rr.com> wrote:
> One way
> =CHAR(LOOKUP(D55,{1,5,9,13,17},{65,66,67,68,69}))
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> dguille...@austin.rr.com<Mark.M.Swee...@gmail.com> wrote in message
>
> news:c920c6c4-2555-4135-8318-32beace0769e@s50g2000hsb.googlegroups.com...
>
>
>
> >I want an IF statement that would be able to do the following:

>
> > IF cell A6 is between 1 and 4 then put "A" in cell A7
> > IF cell A6 is between 5 and 8 then put "B" in cell A7
> > IF cell A6 is between 9 and 12 then put "C" in cell A7
> > IF cell A6 is between 13 and 16 then put "D" in cell A7
> > IF cell A6 is between 17 and 20 then put "E" in cell A7

>
> > Any idea how I could do this?

>
> > Thank you in advance, Mark- Hide quoted text -

>
> - Show quoted text -


Thank you, I put it together without the =CHAR part and it worked
fine. I don't know what the =CHAR part does, would it help?

  Reply With Quote
Old 10-07-2008, 06:27 AM   #8
Rick Rothstein \(MVP - VB\)
Guest
 
Posts: n/a
Default Re: If statements

Depending on if A6 always has a number in it and how high you wanted that
number to be able to go (you can control these with an IF function call if
necessary)...

=CHAR(65+INT((A6-1)/4))

Rick


<Mark.M.Sweeney@gmail.com> wrote in message
news:c920c6c4-2555-4135-8318-32beace0769e@s50g2000hsb.googlegroups.com...
>I want an IF statement that would be able to do the following:
>
> IF cell A6 is between 1 and 4 then put "A" in cell A7
> IF cell A6 is between 5 and 8 then put "B" in cell A7
> IF cell A6 is between 9 and 12 then put "C" in cell A7
> IF cell A6 is between 13 and 16 then put "D" in cell A7
> IF cell A6 is between 17 and 20 then put "E" in cell A7
>
>
> Any idea how I could do this?
>
> Thank you in advance, Mark


  Reply With Quote
Old 28-07-2008, 01:27 AM   #9
Ray
Guest
 
Posts: n/a
Default Re: If statements

I'm no expert like some of these other guys but this is what I would do. I
don't know what you want in A7 if A6 is blank or = 0, or if it is greater
than 20, but this formula placed in cell A7 would accomplish what you want:

=IF(A6<1,"",IF(A6<=4,"A",IF(A6<=8,"B",IF(A6<=12,"C",IF(A6<=16,"D",IF(A6<=20,"E",""))))))

>for A6<1 the "" could be changed to whatever you want A7 to produce, same
>with a value greater than 20.


<Mark.M.Sweeney@gmail.com> wrote in message
news:c920c6c4-2555-4135-8318-32beace0769e@s50g2000hsb.googlegroups.com...
>I want an IF statement that would be able to do the following:
>
> IF cell A6 is between 1 and 4 then put "A" in cell A7
> IF cell A6 is between 5 and 8 then put "B" in cell A7
> IF cell A6 is between 9 and 12 then put "C" in cell A7
> IF cell A6 is between 13 and 16 then put "D" in cell A7
> IF cell A6 is between 17 and 20 then put "E" in cell A7
>
>
> Any idea how I could do this?
>
> Thank you in advance, Mark


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off