Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default IF statement

I have 6 different sheets in my workbook 1 for each of my 5 different
districts in my company and one main sheet. Is it possible to put the
district number in a cell on the main sheet and then reference that cell in
an IF statement to pull data from a particular district? By changing the
value in that single cell, I'd be able to find the same data from each of my
districts.
BTW, I can't use a VLOOKUP or HLOOKUP since the data I am trying to pull is
not in numerical order.

Any help or ideas would be appreciated,
Gary


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default IF statement

Hi Gary,

To help you I think someone would have to look at your workbook and the
sheets, then you would have to explain exeactly what you want pulled from the
sheet or sheets. Your question is too general in nature, if that makes sense.

Thanks,
David

"gbeard" wrote:

I have 6 different sheets in my workbook 1 for each of my 5 different
districts in my company and one main sheet. Is it possible to put the
district number in a cell on the main sheet and then reference that cell in
an IF statement to pull data from a particular district? By changing the
value in that single cell, I'd be able to find the same data from each of my
districts.
BTW, I can't use a VLOOKUP or HLOOKUP since the data I am trying to pull is
not in numerical order.

Any help or ideas would be appreciated,
Gary



  #3   Report Post  
Posted to microsoft.public.excel.programming
RW RW is offline
external usenet poster
 
Posts: 49
Default IF statement

Gary,

Yes, it is possible.

Say your districts are A, B, C, D, E, their corresponding worksheets are
named likewise and B3 of each sheet contains the population.

On your main sheet, A1 contains the district.

To get the population (in say A3 of your main sheet) of the whatever
district is specified in A1, you need to put the following formula in A3:

=IF(A1="A",A!B3,IF(A1="B",B!B3,IF(A1="C",C!B3,IF(A 1="D",D!B3,IF(A1="E",E!B3)))))

Hope this helps,
Rosemary

"gbeard" wrote:

I have 6 different sheets in my workbook 1 for each of my 5 different
districts in my company and one main sheet. Is it possible to put the
district number in a cell on the main sheet and then reference that cell in
an IF statement to pull data from a particular district? By changing the
value in that single cell, I'd be able to find the same data from each of my
districts.
BTW, I can't use a VLOOKUP or HLOOKUP since the data I am trying to pull is
not in numerical order.

Any help or ideas would be appreciated,
Gary



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default IF statement

Hi Gary,

You can use the INDIRECT worksheet function for this.

Cheers


"gbeard" wrote in message
...
I have 6 different sheets in my workbook 1 for each of my 5 different
districts in my company and one main sheet. Is it possible to put the
district number in a cell on the main sheet and then reference that cell

in
an IF statement to pull data from a particular district? By changing the
value in that single cell, I'd be able to find the same data from each of

my
districts.
BTW, I can't use a VLOOKUP or HLOOKUP since the data I am trying to pull

is
not in numerical order.

Any help or ideas would be appreciated,
Gary




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default IF statement

On Tue, 05 Apr 2005 01:40:36 GMT, "gbeard" wrote:

I have 6 different sheets in my workbook 1 for each of my 5 different
districts in my company and one main sheet. Is it possible to put the
district number in a cell on the main sheet and then reference that cell in
an IF statement to pull data from a particular district? By changing the
value in that single cell, I'd be able to find the same data from each of my
districts.
BTW, I can't use a VLOOKUP or HLOOKUP since the data I am trying to pull is
not in numerical order.

Any help or ideas would be appreciated,
Gary


There are many ways of doing this. But where is the data on the district
sheet?

By the way, if the data you are pulling is in a table, if you can accept only
exact matches, there is no requirement that the data be sorted to use HLOOKUP
or VLOOKUP. You can use FALSE for the optional range_lookup argument (see
HELP).

So if you want to do a lookup in a table, and the sheet of the table depends on
the contents of A1, and the data table is in D1:I30 on each sheet, then
something like:

=VLOOKUP(A3,INDIRECT(A1&"!"&"D1:I30"),2,FALSE)

would do a lookup using the contents of A3 as the lookup_value; the contents of
A1 to define the worksheet; and would return the match in column 2 of the
table.




--ron
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
IF statement inside a SUMIF statement.... or alternative method Sungibungi Excel Worksheet Functions 3 December 4th 09 06:22 PM
Reconcile Bank statement & Credit card statement & accounting data Bklynhyc Excel Worksheet Functions 0 October 7th 09 09:07 PM
Embedding an OR statement in an IF statement efficiently Chatnoir11 Excel Discussion (Misc queries) 4 February 2nd 09 08:12 PM
Can an If statement answer an If statement? M.A.Tyler Excel Discussion (Misc queries) 2 June 24th 07 04:14 AM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM


All times are GMT +1. The time now is 08:09 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"