#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rum Rum is offline
external usenet poster
 
Posts: 16
Default If-Then logics

Hi,

I have a work sheet with numbers in 'Column A'. In 'Column B' I wish to get
the following output:

If column A is < 3000 then give me '1'; If column B is 5000 then give me
'3'; if column A is 3000 but <5000 then give me '2'.

Kindly help.

Thanks
Rumneet
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 905
Default If-Then logics

"Rum" wrote:
I have a work sheet with numbers in 'Column A'.
In 'Column B' I wish to get the following output:
If column A is < 3000 then give me '1';
If column B is 5000 then give me '3';
if column A is 3000 but <5000 then give me '2'.


If you mean that for each cell in A, you want the corresponding cell in B to
be 1, 2 or 3, then:

=if(A1<3000, 1, if(A1<5000, 2, 3))

For such a simple choice, I think the IF expression above is the way to go.
But if you had more categories, you might want to consider VLOOKUP. For
example:

=vlookup(A1, {0,3000,5000}, {1, 2, 3})

Note: If A1 might be negative, change 0 to some very large negative number,
e.g. -1E300.


----- original message -----

"Rum" wrote:

Hi,

I have a work sheet with numbers in 'Column A'. In 'Column B' I wish to get
the following output:

If column A is < 3000 then give me '1'; If column B is 5000 then give me
'3'; if column A is 3000 but <5000 then give me '2'.

Kindly help.

Thanks
Rumneet

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 905
Default If-Then logics

Errata...


I wrote:
But if you had more categories, you might want to consider VLOOKUP.
For example:
=vlookup(A1, {0,3000,5000}, {1, 2, 3})


I meant LOOKUP, viz.:

=lookup(A1, {0,3000,5000}, {1, 2, 3})

Moreover, if the result is simply 1, 2, 3, etc, i.e. a category index, MATCH
would suffice. For example:

=match(A1, {0,3000,5000})


----- original message -----

"Joe User" <joeu2004 wrote in message
...
"Rum" wrote:
I have a work sheet with numbers in 'Column A'.
In 'Column B' I wish to get the following output:
If column A is < 3000 then give me '1';
If column B is 5000 then give me '3';
if column A is 3000 but <5000 then give me '2'.


If you mean that for each cell in A, you want the corresponding cell in B
to
be 1, 2 or 3, then:

=if(A1<3000, 1, if(A1<5000, 2, 3))

For such a simple choice, I think the IF expression above is the way to
go.
But if you had more categories, you might want to consider VLOOKUP. For
example:

=vlookup(A1, {0,3000,5000}, {1, 2, 3})

Note: If A1 might be negative, change 0 to some very large negative
number,
e.g. -1E300.


----- original message -----

"Rum" wrote:

Hi,

I have a work sheet with numbers in 'Column A'. In 'Column B' I wish to
get
the following output:

If column A is < 3000 then give me '1'; If column B is 5000 then give me
'3'; if column A is 3000 but <5000 then give me '2'.

Kindly help.

Thanks
Rumneet


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 690
Default If-Then logics

On 3/29/2010 2:46 PM, Rum wrote:
Hi,

I have a work sheet with numbers in 'Column A'. In 'Column B' I wish to get
the following output:

If column A is< 3000 then give me '1'; If column B is5000 then give me
'3'; if column A is3000 but<5000 then give me '2'.

Kindly help.

Thanks
Rumneet


Just another interesting option:

=1+(A1=3000)+(A1=5000)

= = = = = = =
HTH :)
Dana DeLouis
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple logics in one formula Sri Harsha[_2_] Excel Worksheet Functions 1 April 10th 09 07:40 PM
Multiple Logics to be looked at Sri Harsha[_2_] Excel Worksheet Functions 2 April 10th 09 05:46 AM
Creating a formula that uses multiple logics. rpalmer32 New Users to Excel 6 September 24th 08 04:48 PM
filters logics abarwinski Excel Worksheet Functions 0 September 16th 05 11:53 AM


All times are GMT +1. The time now is 04:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"