Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I am trying to use the IF function to search for a certain abbreviation
across a number of different cells across several sheets. I.e. to count the number of cells containing this abbreviation. I have been able to use this for one cell using : IF(D5="RAB",1,0) I.e. if D5 contains RAB count 1, otherwise count 0. How would I reproduce this for a range of cells? Using the same principle : IF(D2:D5="RAB",1,0) However this gives me a result of 0 (when it should be 1) Im not that experienced with excel so am I using the wrong formula or not filling correctly, any suggestions? |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi Rup,
You must be looking for the COUNTIF function =COUNTIF(D2:D5,"RAB") Hope this works for you. Thanks Shail Rup1776 wrote: I am trying to use the IF function to search for a certain abbreviation across a number of different cells across several sheets. I.e. to count the number of cells containing this abbreviation. I have been able to use this for one cell using : IF(D5="RAB",1,0) I.e. if D5 contains RAB count 1, otherwise count 0. How would I reproduce this for a range of cells? Using the same principle : IF(D2:D5="RAB",1,0) However this gives me a result of 0 (when it should be 1) Im not that experienced with excel so am I using the wrong formula or not filling correctly, any suggestions? |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks, yes this does work perfectly, although to get info from different
sheets i have been using =(COUNTIF(D2:D5,"RAB")+COUNTIF(...."RAB")) which seems to work well. Is it possible to autocomplete a new formula to count for "PAR" without having to manually change the formula? Its not important but would save some time Thanks again Rup "shail" wrote: Hi Rup, You must be looking for the COUNTIF function =COUNTIF(D2:D5,"RAB") Hope this works for you. Thanks Shail Rup1776 wrote: I am trying to use the IF function to search for a certain abbreviation across a number of different cells across several sheets. I.e. to count the number of cells containing this abbreviation. I have been able to use this for one cell using : IF(D5="RAB",1,0) I.e. if D5 contains RAB count 1, otherwise count 0. How would I reproduce this for a range of cells? Using the same principle : IF(D2:D5="RAB",1,0) However this gives me a result of 0 (when it should be 1) Im not that experienced with excel so am I using the wrong formula or not filling correctly, any suggestions? |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
hi again Rup,
To count from different worksheets you need to prefix the range with the name of the sheet. Say if your sheet name is "data" then the formula will be =COUNTIF(data!D2:D5,"RAB")+COUNTIF(......) For the second requirement, you need to tell Excel what to COUNT. For this you should include "PAR" in your formula as above in place of "RAB" Or For example, have a cell where you can enter "RAB" or "PAR" say at cell D1 Then the formula will be changed to =COUNTIF(data!D2:D5,D1) now when you enter "RAB" at D1 you will get the count of "RAB" and when you enter "PAR" you will get the count of "PAR". Thanks again Shail Rup1776 wrote: Thanks, yes this does work perfectly, although to get info from different sheets i have been using =(COUNTIF(D2:D5,"RAB")+COUNTIF(...."RAB")) which seems to work well. Is it possible to autocomplete a new formula to count for "PAR" without having to manually change the formula? Its not important but would save some time Thanks again Rup "shail" wrote: Hi Rup, You must be looking for the COUNTIF function =COUNTIF(D2:D5,"RAB") Hope this works for you. Thanks Shail Rup1776 wrote: I am trying to use the IF function to search for a certain abbreviation across a number of different cells across several sheets. I.e. to count the number of cells containing this abbreviation. I have been able to use this for one cell using : IF(D5="RAB",1,0) I.e. if D5 contains RAB count 1, otherwise count 0. How would I reproduce this for a range of cells? Using the same principle : IF(D2:D5="RAB",1,0) However this gives me a result of 0 (when it should be 1) Im not that experienced with excel so am I using the wrong formula or not filling correctly, any suggestions? |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi Paul,
That will definitely return 1, but Rup might want to count the number of thimes "RAB" are appearing. Not just want to know it these are there. Shail paul wrote: your formula will work if you enter it by pressing ctrl and shift and enter together if "rab" is in any one of those cells you will get your formula will look like this {=IF(D2:D5="RAB",1,0)} the curly brackets indicate an array formula which will come automatically upon using the crl shift enter keys together you cant type the {} yourself -- paul remove nospam for email addy! "Rup1776" wrote: I am trying to use the IF function to search for a certain abbreviation across a number of different cells across several sheets. I.e. to count the number of cells containing this abbreviation. I have been able to use this for one cell using : IF(D5="RAB",1,0) I.e. if D5 contains RAB count 1, otherwise count 0. How would I reproduce this for a range of cells? Using the same principle : IF(D2:D5="RAB",1,0) However this gives me a result of 0 (when it should be 1) Im not that experienced with excel so am I using the wrong formula or not filling correctly, any suggestions? |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You can put SUM around it like so:
=SUM(IF(D2:D5="RAB",1,0)) then commit with CTRL-SHIFT-ENTER to make it an array function. Hope this helps. Pete shail wrote: Hi Paul, That will definitely return 1, but Rup might want to count the number of thimes "RAB" are appearing. Not just want to know it these are there. Shail paul wrote: your formula will work if you enter it by pressing ctrl and shift and enter together if "rab" is in any one of those cells you will get your formula will look like this {=IF(D2:D5="RAB",1,0)} the curly brackets indicate an array formula which will come automatically upon using the crl shift enter keys together you cant type the {} yourself -- paul remove nospam for email addy! "Rup1776" wrote: I am trying to use the IF function to search for a certain abbreviation across a number of different cells across several sheets. I.e. to count the number of cells containing this abbreviation. I have been able to use this for one cell using : IF(D5="RAB",1,0) I.e. if D5 contains RAB count 1, otherwise count 0. How would I reproduce this for a range of cells? Using the same principle : IF(D2:D5="RAB",1,0) However this gives me a result of 0 (when it should be 1) Im not that experienced with excel so am I using the wrong formula or not filling correctly, any suggestions? |
#8
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
=SUMPRODUCT(--(D2:D5="RAB"))
"Rup1776" wrote: I am trying to use the IF function to search for a certain abbreviation across a number of different cells across several sheets. I.e. to count the number of cells containing this abbreviation. I have been able to use this for one cell using : IF(D5="RAB",1,0) I.e. if D5 contains RAB count 1, otherwise count 0. How would I reproduce this for a range of cells? Using the same principle : IF(D2:D5="RAB",1,0) However this gives me a result of 0 (when it should be 1) Im not that experienced with excel so am I using the wrong formula or not filling correctly, any suggestions? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|