Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mark
 
Posts: n/a
Default including two ranges of cells in an IF formaula

I wish to query two ranges of cells. the cells are on two separate worksheets
in the same workbook, but do not know how to specify more than one range in
an IF function. i need the formula to look at both ranges for a particular
value
the ranges a
'Substance Use'!G9:G71 and 'Mental Health'!G9:G71

please can you advise how to construct the fiormula.
thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default including two ranges of cells in an IF formaula

Hi
It depends on what you are wanting. You could use OR or AND functions to do
this but we'd need a bit more info!

Andy.

"Mark" wrote in message
...
I wish to query two ranges of cells. the cells are on two separate
worksheets
in the same workbook, but do not know how to specify more than one range
in
an IF function. i need the formula to look at both ranges for a particular
value
the ranges a
'Substance Use'!G9:G71 and 'Mental Health'!G9:G71

please can you advise how to construct the fiormula.
thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mark
 
Posts: n/a
Default including two ranges of cells in an IF formaula

The cells will contain numbers. I want to identify those cells that contain
"40" and then put a value of 40 in the corresponding cell ie if in 'Substance
Use'!G9 there was a value of 40, i would want to put a value of 40 in
'mysheet'!G9. if there was no value of 40, just add 0. If i was looking at
just one range of figures, the formula would be:
=IF('Substance Use'!G9:G71="40","40","0")

but i also need to look at the other range of cells 'Mental Health'!G9:G71
for the same criteria.

"Andy" wrote:

Hi
It depends on what you are wanting. You could use OR or AND functions to do
this but we'd need a bit more info!

Andy.

"Mark" wrote in message
...
I wish to query two ranges of cells. the cells are on two separate
worksheets
in the same workbook, but do not know how to specify more than one range
in
an IF function. i need the formula to look at both ranges for a particular
value
the ranges a
'Substance Use'!G9:G71 and 'Mental Health'!G9:G71

please can you advise how to construct the fiormula.
thanks




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default including two ranges of cells in an IF formaula

Try this:

=IF(OR('Substance Use'!G9:G71="40",'Mental Health'!G9:G71="40"),"40","0")

Andy.

"Mark" wrote in message
...
The cells will contain numbers. I want to identify those cells that
contain
"40" and then put a value of 40 in the corresponding cell ie if in
'Substance
Use'!G9 there was a value of 40, i would want to put a value of 40 in
'mysheet'!G9. if there was no value of 40, just add 0. If i was looking at
just one range of figures, the formula would be:
=IF('Substance Use'!G9:G71="40","40","0")

but i also need to look at the other range of cells 'Mental Health'!G9:G71
for the same criteria.

"Andy" wrote:

Hi
It depends on what you are wanting. You could use OR or AND functions to
do
this but we'd need a bit more info!

Andy.

"Mark" wrote in message
...
I wish to query two ranges of cells. the cells are on two separate
worksheets
in the same workbook, but do not know how to specify more than one
range
in
an IF function. i need the formula to look at both ranges for a
particular
value
the ranges a
'Substance Use'!G9:G71 and 'Mental Health'!G9:G71

please can you advise how to construct the fiormula.
thanks






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default including two ranges of cells in an IF formaula

Surely it should be

=IF(OR('Substance Use'!G9="40",'Mental Health'!G9:="40"),"40","0")

in G9 on MySheet and copy down


--
HTH

Bob Phillips

(replace xxxx in email address with googlemail if mailing direct)

<Andy wrote in message ...
Try this:

=IF(OR('Substance Use'!G9:G71="40",'Mental Health'!G9:G71="40"),"40","0")

Andy.

"Mark" wrote in message
...
The cells will contain numbers. I want to identify those cells that
contain
"40" and then put a value of 40 in the corresponding cell ie if in
'Substance
Use'!G9 there was a value of 40, i would want to put a value of 40 in
'mysheet'!G9. if there was no value of 40, just add 0. If i was looking

at
just one range of figures, the formula would be:
=IF('Substance Use'!G9:G71="40","40","0")

but i also need to look at the other range of cells 'Mental

Health'!G9:G71
for the same criteria.

"Andy" wrote:

Hi
It depends on what you are wanting. You could use OR or AND functions

to
do
this but we'd need a bit more info!

Andy.

"Mark" wrote in message
...
I wish to query two ranges of cells. the cells are on two separate
worksheets
in the same workbook, but do not know how to specify more than one
range
in
an IF function. i need the formula to look at both ranges for a
particular
value
the ranges a
'Substance Use'!G9:G71 and 'Mental Health'!G9:G71

please can you advise how to construct the fiormula.
thanks









  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mark
 
Posts: n/a
Default including two ranges of cells in an IF formaula

Thank you both. This worked when i removed the speech marks from the numbers
in your formula.
Mark

"Bob Phillips" wrote:

Surely it should be

=IF(OR('Substance Use'!G9="40",'Mental Health'!G9:="40"),"40","0")

in G9 on MySheet and copy down


--
HTH

Bob Phillips

(replace xxxx in email address with googlemail if mailing direct)

<Andy wrote in message ...
Try this:

=IF(OR('Substance Use'!G9:G71="40",'Mental Health'!G9:G71="40"),"40","0")

Andy.

"Mark" wrote in message
...
The cells will contain numbers. I want to identify those cells that
contain
"40" and then put a value of 40 in the corresponding cell ie if in
'Substance
Use'!G9 there was a value of 40, i would want to put a value of 40 in
'mysheet'!G9. if there was no value of 40, just add 0. If i was looking

at
just one range of figures, the formula would be:
=IF('Substance Use'!G9:G71="40","40","0")

but i also need to look at the other range of cells 'Mental

Health'!G9:G71
for the same criteria.

"Andy" wrote:

Hi
It depends on what you are wanting. You could use OR or AND functions

to
do
this but we'd need a bit more info!

Andy.

"Mark" wrote in message
...
I wish to query two ranges of cells. the cells are on two separate
worksheets
in the same workbook, but do not know how to specify more than one
range
in
an IF function. i need the formula to look at both ranges for a
particular
value
the ranges a
'Substance Use'!G9:G71 and 'Mental Health'!G9:G71

please can you advise how to construct the fiormula.
thanks








  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default including two ranges of cells in an IF formaula

What do you want to do with the ranges, count a value, compare each , or
what?


--
HTH

Bob Phillips

(replace xxxx in email address with googlemail if mailing direct)

"Mark" wrote in message
...
I wish to query two ranges of cells. the cells are on two separate

worksheets
in the same workbook, but do not know how to specify more than one range

in
an IF function. i need the formula to look at both ranges for a particular
value
the ranges a
'Substance Use'!G9:G71 and 'Mental Health'!G9:G71

please can you advise how to construct the fiormula.
thanks



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
Average range including blank cells: #DIV/0! Areaka Excel Worksheet Functions 3 April 12th 06 10:21 PM
Deleting contents of cells in non contiguous ranges Richard Buttrey Excel Worksheet Functions 9 April 1st 06 11:46 PM
count them number of cells between values -2 and 2 including 0 Helppppppppppppppppppppppppppppp Excel Discussion (Misc queries) 2 March 28th 06 07:41 AM
how to combine including blank cells Karmen New Users to Excel 7 March 15th 06 06:14 PM
empty cells in ranges UniDave Excel Discussion (Misc queries) 2 November 26th 04 02:18 AM


All times are GMT +1. The time now is 12:36 PM.

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

About Us

"It's about Microsoft Excel"