+ Reply to Thread
Results 1 to 66 of 66

IF STATEMEMNTS

  1. #1
    Harlan Grove
    Guest

    Re: IF STATEMEMNTS

    Judy wrote...
    >THANKS everyone. I did get my formula to work with one exception. The
    >column this fomula refers to (J) is also a formula based column and the
    >formula is filled quite a ways down the worksheet, meaning there are sever=

    al
    >rows where #N/A shows until data is entered. If I make the ranges for
    >columns A and J only the populated rows, it works. If I use A:A and J:J, =

    it
    >doesn't... I don't suppose there's a fix for that!

    ..=2E.

    You can't do what you want using entire column references like A:A and
    J:J. If you keep using them, you'll keep getting errors. JE already
    pointed this out to you. If error values as results are fine with you,
    go on using entire column references. On the other hand, if you want
    numeric results, YOU CAN'T USE ENTIRE COLUMN REFERENCES.

    Do you really have data in ALL rows in columns A and J? If not, you
    could use the array formula

    =3DSUM(IF(ISNUMBER(MONTH(A1:A1000)),(MONTH(A1:A1000)=AD=3D9)*(B1:B1000=3D"A=
    ")))


  2. #2
    Judy
    Guest

    Re: IF STATEMEMNTS

    I changed it as follows:

    Your example:
    =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))

    =SUMPRODUCT(--(MONTH('2005'!A:A)=9),--('2005'!J:J="A"))
    I get #NUM! with this one.

    =SUMPRODUCT(--(MONTH('2005'!A1:A2000)=9),--('2005'!J1:J2000="A"))
    I get #VALUE! with this one

    2005 is the name of the worksheet with the data. Thanks for your help.


    "JE McGimpsey" wrote:

    > Probably because the changes you made to the formula were incorrect.
    >
    > What do you mean when you say it didn't work? Did you get an error? an
    > incorrect result? a crash? no result?
    >
    >
    > In article <[email protected]>,
    > "Judy" <[email protected]> wrote:
    >
    > > thanks to you both. This works on the same worksheet, but not a different
    > > worksheet I'm using for a summary... why would that be?

    >


  3. #3
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    Probably because the changes you made to the formula were incorrect.

    What do you mean when you say it didn't work? Did you get an error? an
    incorrect result? a crash? no result?


    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > thanks to you both. This works on the same worksheet, but not a different
    > worksheet I'm using for a summary... why would that be?


  4. #4
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    Your #NUM! error comes from the fact that you can't use entire columns
    (or rows) in array formulae - and SUMPRODUCT is an array formula even if
    you don't need to use Control-Shift-Enter.

    The #VALUE! error works for me. Check to see that you don't have a cell
    with #VALUE! in A1:A2000 or J1:J2000.



    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > I changed it as follows:
    >
    > Your example:
    > =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))
    >
    > =SUMPRODUCT(--(MONTH('2005'!A:A)=9),--('2005'!J:J="A"))
    > I get #NUM! with this one.
    >
    > =SUMPRODUCT(--(MONTH('2005'!A1:A2000)=9),--('2005'!J1:J2000="A"))
    > I get #VALUE! with this one
    >
    > 2005 is the name of the worksheet with the data. Thanks for your help.
    >
    >
    > "JE McGimpsey" wrote:
    >
    > > Probably because the changes you made to the formula were incorrect.
    > >
    > > What do you mean when you say it didn't work? Did you get an error? an
    > > incorrect result? a crash? no result?
    > >
    > >
    > > In article <[email protected]>,
    > > "Judy" <[email protected]> wrote:
    > >
    > > > thanks to you both. This works on the same worksheet, but not a
    > > > different
    > > > worksheet I'm using for a summary... why would that be?

    > >


  5. #5
    Sandy Mann
    Guest

    Re: IF STATEMEMNTS

    "JE McGimpsey" <[email protected]> wrote in message
    news:[email protected]...
    > Your #NUM! error comes from the fact that you can't use entire columns
    > (or rows) in array formulae


    Are you sure? Array fomulas for whole rows seem to work for me.

    --
    Regards

    Sandy
    [email protected]
    Replace@mailinator with @tiscali.co.uk


    "



  6. #6
    Judy
    Guest

    Re: IF STATEMEMNTS

    thanks to you both. This works on the same worksheet, but not a different
    worksheet I'm using for a summary... why would that be?

    "JE McGimpsey" wrote:

    > One way:
    >
    > =SUMPRODUCT(--(A1:A1000=DATE(2005,9,1)),--(B1:B1000="A"))
    >
    > Or if months:
    >
    > =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))
    >
    > In article <[email protected]>,
    > "Judy" <[email protected]> wrote:
    >
    > > I once knew this... how can I nest a COUNTIF statement within an IF
    > > statement? As in, If A:A = 9/1/2005 count B:B if = "A"
    > >
    > > (I'm trying to count the number of As, Bc, Cs, etc based on a large
    > > worksheet by months.
    > >
    > > Thanks!

    >


  7. #7
    Harlan Grove
    Guest

    Re: IF STATEMEMNTS

    JE McGimpsey wrote...
    >Your #NUM! error comes from the fact that you can't use entire columns
    >(or rows) in array formulae - and SUMPRODUCT is an array formula even if
    >you don't need to use Control-Shift-Enter.


    You're wrong about entire rows. They work just fine. Might almost lead
    one to believe Excel's programmers used unsigned short integers to
    index arrays internally without realizing that it'd mean they couldn't
    handle 65,536 entries in any dimension.

    >The #VALUE! error works for me. Check to see that you don't have a cell
    >with #VALUE! in A1:A2000 or J1:J2000.


    Another possibility would be feeding invalid date serial numbers to
    MONTH. Any nonnumeric values or numeric values outside 0 to
    DATE(9999,12,31) will cause MONTH to return #VALUE!.


  8. #8
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    In article <[email protected]>,
    "Harlan Grove" <[email protected]> wrote:

    > You're wrong about entire rows. They work just fine. Might almost lead
    > one to believe Excel's programmers used unsigned short integers to
    > index arrays internally without realizing that it'd mean they couldn't
    > handle 65,536 entries in any dimension.


    Thanks for the correction, Harlan - I never use entire rows, and so I
    forget the reason. Perhaps one more time will make it stick.

  9. #9
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    One way:

    =SUMPRODUCT(--(A1:A1000=DATE(2005,9,1)),--(B1:B1000="A"))

    Or if months:

    =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))

    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > I once knew this... how can I nest a COUNTIF statement within an IF
    > statement? As in, If A:A = 9/1/2005 count B:B if = "A"
    >
    > (I'm trying to count the number of As, Bc, Cs, etc based on a large
    > worksheet by months.
    >
    > Thanks!


  10. #10
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    In article <[email protected]>,
    "Sandy Mann" <[email protected]> wrote:

    > Are you sure? Array fomulas for whole rows seem to work for me.


    No, I was incorrect.

  11. #11
    Judy
    Guest

    Re: IF STATEMEMNTS

    THANKS everyone. I did get my formula to work with one exception. The
    column this fomula refers to (J) is also a formula based column and the
    formula is filled quite a ways down the worksheet, meaning there are several
    rows where #N/A shows until data is entered. If I make the ranges for
    columns A and J only the populated rows, it works. If I use A:A and J:J, it
    doesn't... I don't suppose there's a fix for that!

    Thanks again - appreciated!

    "JE McGimpsey" wrote:

    > In article <[email protected]>,
    > "Harlan Grove" <[email protected]> wrote:
    >
    > > You're wrong about entire rows. They work just fine. Might almost lead
    > > one to believe Excel's programmers used unsigned short integers to
    > > index arrays internally without realizing that it'd mean they couldn't
    > > handle 65,536 entries in any dimension.

    >
    > Thanks for the correction, Harlan - I never use entire rows, and so I
    > forget the reason. Perhaps one more time will make it stick.
    >


  12. #12
    David Billigmeier
    Guest

    RE: IF STATEMEMNTS

    Assume your dates are in the range A1:A5 and column B range is from B1:B5,
    this formula will work:

    =SUMPRODUCT(--(MONTH(A1:A5)=9),--(B1:B5="A"))

    Hope that helps,
    --
    Regards,

    David Billigmeier



    "Judy" wrote:

    > I once knew this... how can I nest a COUNTIF statement within an IF
    > statement? As in, If A:A = 9/1/2005 count B:B if = "A"
    >
    > (I'm trying to count the number of As, Bc, Cs, etc based on a large
    > worksheet by months.
    >
    > Thanks!


  13. #13
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    The fix is to correct the formulas that produce #N/A - in a
    well-designed worksheet, you shouldn't get errors for expected results.

    For instance, if your formula is a VLOOKUP like

    =VLOOKUP(A1234, Sheet2!A:B, 2, FALSE)

    then you could use

    =IF(ISBLANK(A1234), "", VLOOKUP(A1234,Sheet2!A:B, 2, FALSE))



    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > I don't suppose there's a fix for that!


  14. #14
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    In article <[email protected]>,
    "Sandy Mann" <[email protected]> wrote:

    > Are you sure? Array fomulas for whole rows seem to work for me.


    No, I was incorrect.

  15. #15
    Judy
    Guest

    Re: IF STATEMEMNTS

    THANKS everyone. I did get my formula to work with one exception. The
    column this fomula refers to (J) is also a formula based column and the
    formula is filled quite a ways down the worksheet, meaning there are several
    rows where #N/A shows until data is entered. If I make the ranges for
    columns A and J only the populated rows, it works. If I use A:A and J:J, it
    doesn't... I don't suppose there's a fix for that!

    Thanks again - appreciated!

    "JE McGimpsey" wrote:

    > In article <[email protected]>,
    > "Harlan Grove" <[email protected]> wrote:
    >
    > > You're wrong about entire rows. They work just fine. Might almost lead
    > > one to believe Excel's programmers used unsigned short integers to
    > > index arrays internally without realizing that it'd mean they couldn't
    > > handle 65,536 entries in any dimension.

    >
    > Thanks for the correction, Harlan - I never use entire rows, and so I
    > forget the reason. Perhaps one more time will make it stick.
    >


  16. #16
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    In article <[email protected]>,
    "Harlan Grove" <[email protected]> wrote:

    > You're wrong about entire rows. They work just fine. Might almost lead
    > one to believe Excel's programmers used unsigned short integers to
    > index arrays internally without realizing that it'd mean they couldn't
    > handle 65,536 entries in any dimension.


    Thanks for the correction, Harlan - I never use entire rows, and so I
    forget the reason. Perhaps one more time will make it stick.

  17. #17
    Harlan Grove
    Guest

    Re: IF STATEMEMNTS

    JE McGimpsey wrote...
    >Your #NUM! error comes from the fact that you can't use entire columns
    >(or rows) in array formulae - and SUMPRODUCT is an array formula even if
    >you don't need to use Control-Shift-Enter.


    You're wrong about entire rows. They work just fine. Might almost lead
    one to believe Excel's programmers used unsigned short integers to
    index arrays internally without realizing that it'd mean they couldn't
    handle 65,536 entries in any dimension.

    >The #VALUE! error works for me. Check to see that you don't have a cell
    >with #VALUE! in A1:A2000 or J1:J2000.


    Another possibility would be feeding invalid date serial numbers to
    MONTH. Any nonnumeric values or numeric values outside 0 to
    DATE(9999,12,31) will cause MONTH to return #VALUE!.


  18. #18
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    The fix is to correct the formulas that produce #N/A - in a
    well-designed worksheet, you shouldn't get errors for expected results.

    For instance, if your formula is a VLOOKUP like

    =VLOOKUP(A1234, Sheet2!A:B, 2, FALSE)

    then you could use

    =IF(ISBLANK(A1234), "", VLOOKUP(A1234,Sheet2!A:B, 2, FALSE))



    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > I don't suppose there's a fix for that!


  19. #19
    Harlan Grove
    Guest

    Re: IF STATEMEMNTS

    Judy wrote...
    >THANKS everyone. I did get my formula to work with one exception. The
    >column this fomula refers to (J) is also a formula based column and the
    >formula is filled quite a ways down the worksheet, meaning there are sever=

    al
    >rows where #N/A shows until data is entered. If I make the ranges for
    >columns A and J only the populated rows, it works. If I use A:A and J:J, =

    it
    >doesn't... I don't suppose there's a fix for that!

    ..=2E.

    You can't do what you want using entire column references like A:A and
    J:J. If you keep using them, you'll keep getting errors. JE already
    pointed this out to you. If error values as results are fine with you,
    go on using entire column references. On the other hand, if you want
    numeric results, YOU CAN'T USE ENTIRE COLUMN REFERENCES.

    Do you really have data in ALL rows in columns A and J? If not, you
    could use the array formula

    =3DSUM(IF(ISNUMBER(MONTH(A1:A1000)),(MONTH(A1:A1000)=AD=3D9)*(B1:B1000=3D"A=
    ")))


  20. #20
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    Your #NUM! error comes from the fact that you can't use entire columns
    (or rows) in array formulae - and SUMPRODUCT is an array formula even if
    you don't need to use Control-Shift-Enter.

    The #VALUE! error works for me. Check to see that you don't have a cell
    with #VALUE! in A1:A2000 or J1:J2000.



    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > I changed it as follows:
    >
    > Your example:
    > =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))
    >
    > =SUMPRODUCT(--(MONTH('2005'!A:A)=9),--('2005'!J:J="A"))
    > I get #NUM! with this one.
    >
    > =SUMPRODUCT(--(MONTH('2005'!A1:A2000)=9),--('2005'!J1:J2000="A"))
    > I get #VALUE! with this one
    >
    > 2005 is the name of the worksheet with the data. Thanks for your help.
    >
    >
    > "JE McGimpsey" wrote:
    >
    > > Probably because the changes you made to the formula were incorrect.
    > >
    > > What do you mean when you say it didn't work? Did you get an error? an
    > > incorrect result? a crash? no result?
    > >
    > >
    > > In article <[email protected]>,
    > > "Judy" <[email protected]> wrote:
    > >
    > > > thanks to you both. This works on the same worksheet, but not a
    > > > different
    > > > worksheet I'm using for a summary... why would that be?

    > >


  21. #21
    Sandy Mann
    Guest

    Re: IF STATEMEMNTS

    "JE McGimpsey" <[email protected]> wrote in message
    news:[email protected]...
    > Your #NUM! error comes from the fact that you can't use entire columns
    > (or rows) in array formulae


    Are you sure? Array fomulas for whole rows seem to work for me.

    --
    Regards

    Sandy
    [email protected]
    Replace@mailinator with @tiscali.co.uk


    "



  22. #22
    Judy
    Guest

    Re: IF STATEMEMNTS

    I changed it as follows:

    Your example:
    =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))

    =SUMPRODUCT(--(MONTH('2005'!A:A)=9),--('2005'!J:J="A"))
    I get #NUM! with this one.

    =SUMPRODUCT(--(MONTH('2005'!A1:A2000)=9),--('2005'!J1:J2000="A"))
    I get #VALUE! with this one

    2005 is the name of the worksheet with the data. Thanks for your help.


    "JE McGimpsey" wrote:

    > Probably because the changes you made to the formula were incorrect.
    >
    > What do you mean when you say it didn't work? Did you get an error? an
    > incorrect result? a crash? no result?
    >
    >
    > In article <[email protected]>,
    > "Judy" <[email protected]> wrote:
    >
    > > thanks to you both. This works on the same worksheet, but not a different
    > > worksheet I'm using for a summary... why would that be?

    >


  23. #23
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    One way:

    =SUMPRODUCT(--(A1:A1000=DATE(2005,9,1)),--(B1:B1000="A"))

    Or if months:

    =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))

    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > I once knew this... how can I nest a COUNTIF statement within an IF
    > statement? As in, If A:A = 9/1/2005 count B:B if = "A"
    >
    > (I'm trying to count the number of As, Bc, Cs, etc based on a large
    > worksheet by months.
    >
    > Thanks!


  24. #24
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    Probably because the changes you made to the formula were incorrect.

    What do you mean when you say it didn't work? Did you get an error? an
    incorrect result? a crash? no result?


    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > thanks to you both. This works on the same worksheet, but not a different
    > worksheet I'm using for a summary... why would that be?


  25. #25
    Judy
    Guest

    Re: IF STATEMEMNTS

    thanks to you both. This works on the same worksheet, but not a different
    worksheet I'm using for a summary... why would that be?

    "JE McGimpsey" wrote:

    > One way:
    >
    > =SUMPRODUCT(--(A1:A1000=DATE(2005,9,1)),--(B1:B1000="A"))
    >
    > Or if months:
    >
    > =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))
    >
    > In article <[email protected]>,
    > "Judy" <[email protected]> wrote:
    >
    > > I once knew this... how can I nest a COUNTIF statement within an IF
    > > statement? As in, If A:A = 9/1/2005 count B:B if = "A"
    > >
    > > (I'm trying to count the number of As, Bc, Cs, etc based on a large
    > > worksheet by months.
    > >
    > > Thanks!

    >


  26. #26
    David Billigmeier
    Guest

    RE: IF STATEMEMNTS

    Assume your dates are in the range A1:A5 and column B range is from B1:B5,
    this formula will work:

    =SUMPRODUCT(--(MONTH(A1:A5)=9),--(B1:B5="A"))

    Hope that helps,
    --
    Regards,

    David Billigmeier



    "Judy" wrote:

    > I once knew this... how can I nest a COUNTIF statement within an IF
    > statement? As in, If A:A = 9/1/2005 count B:B if = "A"
    >
    > (I'm trying to count the number of As, Bc, Cs, etc based on a large
    > worksheet by months.
    >
    > Thanks!


  27. #27
    David Billigmeier
    Guest

    RE: IF STATEMEMNTS

    Assume your dates are in the range A1:A5 and column B range is from B1:B5,
    this formula will work:

    =SUMPRODUCT(--(MONTH(A1:A5)=9),--(B1:B5="A"))

    Hope that helps,
    --
    Regards,

    David Billigmeier



    "Judy" wrote:

    > I once knew this... how can I nest a COUNTIF statement within an IF
    > statement? As in, If A:A = 9/1/2005 count B:B if = "A"
    >
    > (I'm trying to count the number of As, Bc, Cs, etc based on a large
    > worksheet by months.
    >
    > Thanks!


  28. #28
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    In article <[email protected]>,
    "Sandy Mann" <[email protected]> wrote:

    > Are you sure? Array fomulas for whole rows seem to work for me.


    No, I was incorrect.

  29. #29
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    In article <[email protected]>,
    "Harlan Grove" <[email protected]> wrote:

    > You're wrong about entire rows. They work just fine. Might almost lead
    > one to believe Excel's programmers used unsigned short integers to
    > index arrays internally without realizing that it'd mean they couldn't
    > handle 65,536 entries in any dimension.


    Thanks for the correction, Harlan - I never use entire rows, and so I
    forget the reason. Perhaps one more time will make it stick.

  30. #30
    Judy
    Guest

    Re: IF STATEMEMNTS

    thanks to you both. This works on the same worksheet, but not a different
    worksheet I'm using for a summary... why would that be?

    "JE McGimpsey" wrote:

    > One way:
    >
    > =SUMPRODUCT(--(A1:A1000=DATE(2005,9,1)),--(B1:B1000="A"))
    >
    > Or if months:
    >
    > =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))
    >
    > In article <[email protected]>,
    > "Judy" <[email protected]> wrote:
    >
    > > I once knew this... how can I nest a COUNTIF statement within an IF
    > > statement? As in, If A:A = 9/1/2005 count B:B if = "A"
    > >
    > > (I'm trying to count the number of As, Bc, Cs, etc based on a large
    > > worksheet by months.
    > >
    > > Thanks!

    >


  31. #31
    Judy
    Guest

    Re: IF STATEMEMNTS

    THANKS everyone. I did get my formula to work with one exception. The
    column this fomula refers to (J) is also a formula based column and the
    formula is filled quite a ways down the worksheet, meaning there are several
    rows where #N/A shows until data is entered. If I make the ranges for
    columns A and J only the populated rows, it works. If I use A:A and J:J, it
    doesn't... I don't suppose there's a fix for that!

    Thanks again - appreciated!

    "JE McGimpsey" wrote:

    > In article <[email protected]>,
    > "Harlan Grove" <[email protected]> wrote:
    >
    > > You're wrong about entire rows. They work just fine. Might almost lead
    > > one to believe Excel's programmers used unsigned short integers to
    > > index arrays internally without realizing that it'd mean they couldn't
    > > handle 65,536 entries in any dimension.

    >
    > Thanks for the correction, Harlan - I never use entire rows, and so I
    > forget the reason. Perhaps one more time will make it stick.
    >


  32. #32
    Harlan Grove
    Guest

    Re: IF STATEMEMNTS

    JE McGimpsey wrote...
    >Your #NUM! error comes from the fact that you can't use entire columns
    >(or rows) in array formulae - and SUMPRODUCT is an array formula even if
    >you don't need to use Control-Shift-Enter.


    You're wrong about entire rows. They work just fine. Might almost lead
    one to believe Excel's programmers used unsigned short integers to
    index arrays internally without realizing that it'd mean they couldn't
    handle 65,536 entries in any dimension.

    >The #VALUE! error works for me. Check to see that you don't have a cell
    >with #VALUE! in A1:A2000 or J1:J2000.


    Another possibility would be feeding invalid date serial numbers to
    MONTH. Any nonnumeric values or numeric values outside 0 to
    DATE(9999,12,31) will cause MONTH to return #VALUE!.


  33. #33
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    One way:

    =SUMPRODUCT(--(A1:A1000=DATE(2005,9,1)),--(B1:B1000="A"))

    Or if months:

    =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))

    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > I once knew this... how can I nest a COUNTIF statement within an IF
    > statement? As in, If A:A = 9/1/2005 count B:B if = "A"
    >
    > (I'm trying to count the number of As, Bc, Cs, etc based on a large
    > worksheet by months.
    >
    > Thanks!


  34. #34
    Sandy Mann
    Guest

    Re: IF STATEMEMNTS

    "JE McGimpsey" <[email protected]> wrote in message
    news:[email protected]...
    > Your #NUM! error comes from the fact that you can't use entire columns
    > (or rows) in array formulae


    Are you sure? Array fomulas for whole rows seem to work for me.

    --
    Regards

    Sandy
    [email protected]
    Replace@mailinator with @tiscali.co.uk


    "



  35. #35
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    The fix is to correct the formulas that produce #N/A - in a
    well-designed worksheet, you shouldn't get errors for expected results.

    For instance, if your formula is a VLOOKUP like

    =VLOOKUP(A1234, Sheet2!A:B, 2, FALSE)

    then you could use

    =IF(ISBLANK(A1234), "", VLOOKUP(A1234,Sheet2!A:B, 2, FALSE))



    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > I don't suppose there's a fix for that!


  36. #36
    Harlan Grove
    Guest

    Re: IF STATEMEMNTS

    Judy wrote...
    >THANKS everyone. I did get my formula to work with one exception. The
    >column this fomula refers to (J) is also a formula based column and the
    >formula is filled quite a ways down the worksheet, meaning there are sever=

    al
    >rows where #N/A shows until data is entered. If I make the ranges for
    >columns A and J only the populated rows, it works. If I use A:A and J:J, =

    it
    >doesn't... I don't suppose there's a fix for that!

    ..=2E.

    You can't do what you want using entire column references like A:A and
    J:J. If you keep using them, you'll keep getting errors. JE already
    pointed this out to you. If error values as results are fine with you,
    go on using entire column references. On the other hand, if you want
    numeric results, YOU CAN'T USE ENTIRE COLUMN REFERENCES.

    Do you really have data in ALL rows in columns A and J? If not, you
    could use the array formula

    =3DSUM(IF(ISNUMBER(MONTH(A1:A1000)),(MONTH(A1:A1000)=AD=3D9)*(B1:B1000=3D"A=
    ")))


  37. #37
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    Your #NUM! error comes from the fact that you can't use entire columns
    (or rows) in array formulae - and SUMPRODUCT is an array formula even if
    you don't need to use Control-Shift-Enter.

    The #VALUE! error works for me. Check to see that you don't have a cell
    with #VALUE! in A1:A2000 or J1:J2000.



    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > I changed it as follows:
    >
    > Your example:
    > =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))
    >
    > =SUMPRODUCT(--(MONTH('2005'!A:A)=9),--('2005'!J:J="A"))
    > I get #NUM! with this one.
    >
    > =SUMPRODUCT(--(MONTH('2005'!A1:A2000)=9),--('2005'!J1:J2000="A"))
    > I get #VALUE! with this one
    >
    > 2005 is the name of the worksheet with the data. Thanks for your help.
    >
    >
    > "JE McGimpsey" wrote:
    >
    > > Probably because the changes you made to the formula were incorrect.
    > >
    > > What do you mean when you say it didn't work? Did you get an error? an
    > > incorrect result? a crash? no result?
    > >
    > >
    > > In article <[email protected]>,
    > > "Judy" <[email protected]> wrote:
    > >
    > > > thanks to you both. This works on the same worksheet, but not a
    > > > different
    > > > worksheet I'm using for a summary... why would that be?

    > >


  38. #38
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    Probably because the changes you made to the formula were incorrect.

    What do you mean when you say it didn't work? Did you get an error? an
    incorrect result? a crash? no result?


    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > thanks to you both. This works on the same worksheet, but not a different
    > worksheet I'm using for a summary... why would that be?


  39. #39
    Judy
    Guest

    Re: IF STATEMEMNTS

    I changed it as follows:

    Your example:
    =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))

    =SUMPRODUCT(--(MONTH('2005'!A:A)=9),--('2005'!J:J="A"))
    I get #NUM! with this one.

    =SUMPRODUCT(--(MONTH('2005'!A1:A2000)=9),--('2005'!J1:J2000="A"))
    I get #VALUE! with this one

    2005 is the name of the worksheet with the data. Thanks for your help.


    "JE McGimpsey" wrote:

    > Probably because the changes you made to the formula were incorrect.
    >
    > What do you mean when you say it didn't work? Did you get an error? an
    > incorrect result? a crash? no result?
    >
    >
    > In article <[email protected]>,
    > "Judy" <[email protected]> wrote:
    >
    > > thanks to you both. This works on the same worksheet, but not a different
    > > worksheet I'm using for a summary... why would that be?

    >


  40. #40
    David Billigmeier
    Guest

    RE: IF STATEMEMNTS

    Assume your dates are in the range A1:A5 and column B range is from B1:B5,
    this formula will work:

    =SUMPRODUCT(--(MONTH(A1:A5)=9),--(B1:B5="A"))

    Hope that helps,
    --
    Regards,

    David Billigmeier



    "Judy" wrote:

    > I once knew this... how can I nest a COUNTIF statement within an IF
    > statement? As in, If A:A = 9/1/2005 count B:B if = "A"
    >
    > (I'm trying to count the number of As, Bc, Cs, etc based on a large
    > worksheet by months.
    >
    > Thanks!


  41. #41
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    The fix is to correct the formulas that produce #N/A - in a
    well-designed worksheet, you shouldn't get errors for expected results.

    For instance, if your formula is a VLOOKUP like

    =VLOOKUP(A1234, Sheet2!A:B, 2, FALSE)

    then you could use

    =IF(ISBLANK(A1234), "", VLOOKUP(A1234,Sheet2!A:B, 2, FALSE))



    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > I don't suppose there's a fix for that!


  42. #42
    Judy
    Guest

    Re: IF STATEMEMNTS

    THANKS everyone. I did get my formula to work with one exception. The
    column this fomula refers to (J) is also a formula based column and the
    formula is filled quite a ways down the worksheet, meaning there are several
    rows where #N/A shows until data is entered. If I make the ranges for
    columns A and J only the populated rows, it works. If I use A:A and J:J, it
    doesn't... I don't suppose there's a fix for that!

    Thanks again - appreciated!

    "JE McGimpsey" wrote:

    > In article <[email protected]>,
    > "Harlan Grove" <[email protected]> wrote:
    >
    > > You're wrong about entire rows. They work just fine. Might almost lead
    > > one to believe Excel's programmers used unsigned short integers to
    > > index arrays internally without realizing that it'd mean they couldn't
    > > handle 65,536 entries in any dimension.

    >
    > Thanks for the correction, Harlan - I never use entire rows, and so I
    > forget the reason. Perhaps one more time will make it stick.
    >


  43. #43
    Harlan Grove
    Guest

    Re: IF STATEMEMNTS

    Judy wrote...
    >THANKS everyone. I did get my formula to work with one exception. The
    >column this fomula refers to (J) is also a formula based column and the
    >formula is filled quite a ways down the worksheet, meaning there are sever=

    al
    >rows where #N/A shows until data is entered. If I make the ranges for
    >columns A and J only the populated rows, it works. If I use A:A and J:J, =

    it
    >doesn't... I don't suppose there's a fix for that!

    ..=2E.

    You can't do what you want using entire column references like A:A and
    J:J. If you keep using them, you'll keep getting errors. JE already
    pointed this out to you. If error values as results are fine with you,
    go on using entire column references. On the other hand, if you want
    numeric results, YOU CAN'T USE ENTIRE COLUMN REFERENCES.

    Do you really have data in ALL rows in columns A and J? If not, you
    could use the array formula

    =3DSUM(IF(ISNUMBER(MONTH(A1:A1000)),(MONTH(A1:A1000)=AD=3D9)*(B1:B1000=3D"A=
    ")))


  44. #44
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    One way:

    =SUMPRODUCT(--(A1:A1000=DATE(2005,9,1)),--(B1:B1000="A"))

    Or if months:

    =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))

    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > I once knew this... how can I nest a COUNTIF statement within an IF
    > statement? As in, If A:A = 9/1/2005 count B:B if = "A"
    >
    > (I'm trying to count the number of As, Bc, Cs, etc based on a large
    > worksheet by months.
    >
    > Thanks!


  45. #45
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    In article <[email protected]>,
    "Harlan Grove" <[email protected]> wrote:

    > You're wrong about entire rows. They work just fine. Might almost lead
    > one to believe Excel's programmers used unsigned short integers to
    > index arrays internally without realizing that it'd mean they couldn't
    > handle 65,536 entries in any dimension.


    Thanks for the correction, Harlan - I never use entire rows, and so I
    forget the reason. Perhaps one more time will make it stick.

  46. #46
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    In article <[email protected]>,
    "Sandy Mann" <[email protected]> wrote:

    > Are you sure? Array fomulas for whole rows seem to work for me.


    No, I was incorrect.

  47. #47
    Judy
    Guest

    Re: IF STATEMEMNTS

    I changed it as follows:

    Your example:
    =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))

    =SUMPRODUCT(--(MONTH('2005'!A:A)=9),--('2005'!J:J="A"))
    I get #NUM! with this one.

    =SUMPRODUCT(--(MONTH('2005'!A1:A2000)=9),--('2005'!J1:J2000="A"))
    I get #VALUE! with this one

    2005 is the name of the worksheet with the data. Thanks for your help.


    "JE McGimpsey" wrote:

    > Probably because the changes you made to the formula were incorrect.
    >
    > What do you mean when you say it didn't work? Did you get an error? an
    > incorrect result? a crash? no result?
    >
    >
    > In article <[email protected]>,
    > "Judy" <[email protected]> wrote:
    >
    > > thanks to you both. This works on the same worksheet, but not a different
    > > worksheet I'm using for a summary... why would that be?

    >


  48. #48
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    Your #NUM! error comes from the fact that you can't use entire columns
    (or rows) in array formulae - and SUMPRODUCT is an array formula even if
    you don't need to use Control-Shift-Enter.

    The #VALUE! error works for me. Check to see that you don't have a cell
    with #VALUE! in A1:A2000 or J1:J2000.



    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > I changed it as follows:
    >
    > Your example:
    > =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))
    >
    > =SUMPRODUCT(--(MONTH('2005'!A:A)=9),--('2005'!J:J="A"))
    > I get #NUM! with this one.
    >
    > =SUMPRODUCT(--(MONTH('2005'!A1:A2000)=9),--('2005'!J1:J2000="A"))
    > I get #VALUE! with this one
    >
    > 2005 is the name of the worksheet with the data. Thanks for your help.
    >
    >
    > "JE McGimpsey" wrote:
    >
    > > Probably because the changes you made to the formula were incorrect.
    > >
    > > What do you mean when you say it didn't work? Did you get an error? an
    > > incorrect result? a crash? no result?
    > >
    > >
    > > In article <[email protected]>,
    > > "Judy" <[email protected]> wrote:
    > >
    > > > thanks to you both. This works on the same worksheet, but not a
    > > > different
    > > > worksheet I'm using for a summary... why would that be?

    > >


  49. #49
    Judy
    Guest

    Re: IF STATEMEMNTS

    thanks to you both. This works on the same worksheet, but not a different
    worksheet I'm using for a summary... why would that be?

    "JE McGimpsey" wrote:

    > One way:
    >
    > =SUMPRODUCT(--(A1:A1000=DATE(2005,9,1)),--(B1:B1000="A"))
    >
    > Or if months:
    >
    > =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))
    >
    > In article <[email protected]>,
    > "Judy" <[email protected]> wrote:
    >
    > > I once knew this... how can I nest a COUNTIF statement within an IF
    > > statement? As in, If A:A = 9/1/2005 count B:B if = "A"
    > >
    > > (I'm trying to count the number of As, Bc, Cs, etc based on a large
    > > worksheet by months.
    > >
    > > Thanks!

    >


  50. #50
    Harlan Grove
    Guest

    Re: IF STATEMEMNTS

    JE McGimpsey wrote...
    >Your #NUM! error comes from the fact that you can't use entire columns
    >(or rows) in array formulae - and SUMPRODUCT is an array formula even if
    >you don't need to use Control-Shift-Enter.


    You're wrong about entire rows. They work just fine. Might almost lead
    one to believe Excel's programmers used unsigned short integers to
    index arrays internally without realizing that it'd mean they couldn't
    handle 65,536 entries in any dimension.

    >The #VALUE! error works for me. Check to see that you don't have a cell
    >with #VALUE! in A1:A2000 or J1:J2000.


    Another possibility would be feeding invalid date serial numbers to
    MONTH. Any nonnumeric values or numeric values outside 0 to
    DATE(9999,12,31) will cause MONTH to return #VALUE!.


  51. #51
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    Probably because the changes you made to the formula were incorrect.

    What do you mean when you say it didn't work? Did you get an error? an
    incorrect result? a crash? no result?


    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > thanks to you both. This works on the same worksheet, but not a different
    > worksheet I'm using for a summary... why would that be?


  52. #52
    Sandy Mann
    Guest

    Re: IF STATEMEMNTS

    "JE McGimpsey" <[email protected]> wrote in message
    news:[email protected]...
    > Your #NUM! error comes from the fact that you can't use entire columns
    > (or rows) in array formulae


    Are you sure? Array fomulas for whole rows seem to work for me.

    --
    Regards

    Sandy
    [email protected]
    Replace@mailinator with @tiscali.co.uk


    "



  53. #53
    Judy
    Guest

    Re: IF STATEMEMNTS

    I changed it as follows:

    Your example:
    =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))

    =SUMPRODUCT(--(MONTH('2005'!A:A)=9),--('2005'!J:J="A"))
    I get #NUM! with this one.

    =SUMPRODUCT(--(MONTH('2005'!A1:A2000)=9),--('2005'!J1:J2000="A"))
    I get #VALUE! with this one

    2005 is the name of the worksheet with the data. Thanks for your help.


    "JE McGimpsey" wrote:

    > Probably because the changes you made to the formula were incorrect.
    >
    > What do you mean when you say it didn't work? Did you get an error? an
    > incorrect result? a crash? no result?
    >
    >
    > In article <[email protected]>,
    > "Judy" <[email protected]> wrote:
    >
    > > thanks to you both. This works on the same worksheet, but not a different
    > > worksheet I'm using for a summary... why would that be?

    >


  54. #54
    Harlan Grove
    Guest

    Re: IF STATEMEMNTS

    Judy wrote...
    >THANKS everyone. I did get my formula to work with one exception. The
    >column this fomula refers to (J) is also a formula based column and the
    >formula is filled quite a ways down the worksheet, meaning there are sever=

    al
    >rows where #N/A shows until data is entered. If I make the ranges for
    >columns A and J only the populated rows, it works. If I use A:A and J:J, =

    it
    >doesn't... I don't suppose there's a fix for that!

    ..=2E.

    You can't do what you want using entire column references like A:A and
    J:J. If you keep using them, you'll keep getting errors. JE already
    pointed this out to you. If error values as results are fine with you,
    go on using entire column references. On the other hand, if you want
    numeric results, YOU CAN'T USE ENTIRE COLUMN REFERENCES.

    Do you really have data in ALL rows in columns A and J? If not, you
    could use the array formula

    =3DSUM(IF(ISNUMBER(MONTH(A1:A1000)),(MONTH(A1:A1000)=AD=3D9)*(B1:B1000=3D"A=
    ")))


  55. #55
    David Billigmeier
    Guest

    RE: IF STATEMEMNTS

    Assume your dates are in the range A1:A5 and column B range is from B1:B5,
    this formula will work:

    =SUMPRODUCT(--(MONTH(A1:A5)=9),--(B1:B5="A"))

    Hope that helps,
    --
    Regards,

    David Billigmeier



    "Judy" wrote:

    > I once knew this... how can I nest a COUNTIF statement within an IF
    > statement? As in, If A:A = 9/1/2005 count B:B if = "A"
    >
    > (I'm trying to count the number of As, Bc, Cs, etc based on a large
    > worksheet by months.
    >
    > Thanks!


  56. #56
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    Your #NUM! error comes from the fact that you can't use entire columns
    (or rows) in array formulae - and SUMPRODUCT is an array formula even if
    you don't need to use Control-Shift-Enter.

    The #VALUE! error works for me. Check to see that you don't have a cell
    with #VALUE! in A1:A2000 or J1:J2000.



    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > I changed it as follows:
    >
    > Your example:
    > =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))
    >
    > =SUMPRODUCT(--(MONTH('2005'!A:A)=9),--('2005'!J:J="A"))
    > I get #NUM! with this one.
    >
    > =SUMPRODUCT(--(MONTH('2005'!A1:A2000)=9),--('2005'!J1:J2000="A"))
    > I get #VALUE! with this one
    >
    > 2005 is the name of the worksheet with the data. Thanks for your help.
    >
    >
    > "JE McGimpsey" wrote:
    >
    > > Probably because the changes you made to the formula were incorrect.
    > >
    > > What do you mean when you say it didn't work? Did you get an error? an
    > > incorrect result? a crash? no result?
    > >
    > >
    > > In article <[email protected]>,
    > > "Judy" <[email protected]> wrote:
    > >
    > > > thanks to you both. This works on the same worksheet, but not a
    > > > different
    > > > worksheet I'm using for a summary... why would that be?

    > >


  57. #57
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    Probably because the changes you made to the formula were incorrect.

    What do you mean when you say it didn't work? Did you get an error? an
    incorrect result? a crash? no result?


    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > thanks to you both. This works on the same worksheet, but not a different
    > worksheet I'm using for a summary... why would that be?


  58. #58
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    The fix is to correct the formulas that produce #N/A - in a
    well-designed worksheet, you shouldn't get errors for expected results.

    For instance, if your formula is a VLOOKUP like

    =VLOOKUP(A1234, Sheet2!A:B, 2, FALSE)

    then you could use

    =IF(ISBLANK(A1234), "", VLOOKUP(A1234,Sheet2!A:B, 2, FALSE))



    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > I don't suppose there's a fix for that!


  59. #59
    Sandy Mann
    Guest

    Re: IF STATEMEMNTS

    "JE McGimpsey" <[email protected]> wrote in message
    news:[email protected]...
    > Your #NUM! error comes from the fact that you can't use entire columns
    > (or rows) in array formulae


    Are you sure? Array fomulas for whole rows seem to work for me.

    --
    Regards

    Sandy
    [email protected]
    Replace@mailinator with @tiscali.co.uk


    "



  60. #60
    Judy
    Guest

    IF STATEMEMNTS

    I once knew this... how can I nest a COUNTIF statement within an IF
    statement? As in, If A:A = 9/1/2005 count B:B if = "A"

    (I'm trying to count the number of As, Bc, Cs, etc based on a large
    worksheet by months.

    Thanks!

  61. #61
    Harlan Grove
    Guest

    Re: IF STATEMEMNTS

    JE McGimpsey wrote...
    >Your #NUM! error comes from the fact that you can't use entire columns
    >(or rows) in array formulae - and SUMPRODUCT is an array formula even if
    >you don't need to use Control-Shift-Enter.


    You're wrong about entire rows. They work just fine. Might almost lead
    one to believe Excel's programmers used unsigned short integers to
    index arrays internally without realizing that it'd mean they couldn't
    handle 65,536 entries in any dimension.

    >The #VALUE! error works for me. Check to see that you don't have a cell
    >with #VALUE! in A1:A2000 or J1:J2000.


    Another possibility would be feeding invalid date serial numbers to
    MONTH. Any nonnumeric values or numeric values outside 0 to
    DATE(9999,12,31) will cause MONTH to return #VALUE!.


  62. #62
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    One way:

    =SUMPRODUCT(--(A1:A1000=DATE(2005,9,1)),--(B1:B1000="A"))

    Or if months:

    =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))

    In article <[email protected]>,
    "Judy" <[email protected]> wrote:

    > I once knew this... how can I nest a COUNTIF statement within an IF
    > statement? As in, If A:A = 9/1/2005 count B:B if = "A"
    >
    > (I'm trying to count the number of As, Bc, Cs, etc based on a large
    > worksheet by months.
    >
    > Thanks!


  63. #63
    Judy
    Guest

    Re: IF STATEMEMNTS

    THANKS everyone. I did get my formula to work with one exception. The
    column this fomula refers to (J) is also a formula based column and the
    formula is filled quite a ways down the worksheet, meaning there are several
    rows where #N/A shows until data is entered. If I make the ranges for
    columns A and J only the populated rows, it works. If I use A:A and J:J, it
    doesn't... I don't suppose there's a fix for that!

    Thanks again - appreciated!

    "JE McGimpsey" wrote:

    > In article <[email protected]>,
    > "Harlan Grove" <[email protected]> wrote:
    >
    > > You're wrong about entire rows. They work just fine. Might almost lead
    > > one to believe Excel's programmers used unsigned short integers to
    > > index arrays internally without realizing that it'd mean they couldn't
    > > handle 65,536 entries in any dimension.

    >
    > Thanks for the correction, Harlan - I never use entire rows, and so I
    > forget the reason. Perhaps one more time will make it stick.
    >


  64. #64
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    In article <[email protected]>,
    "Harlan Grove" <[email protected]> wrote:

    > You're wrong about entire rows. They work just fine. Might almost lead
    > one to believe Excel's programmers used unsigned short integers to
    > index arrays internally without realizing that it'd mean they couldn't
    > handle 65,536 entries in any dimension.


    Thanks for the correction, Harlan - I never use entire rows, and so I
    forget the reason. Perhaps one more time will make it stick.

  65. #65
    Judy
    Guest

    Re: IF STATEMEMNTS

    thanks to you both. This works on the same worksheet, but not a different
    worksheet I'm using for a summary... why would that be?

    "JE McGimpsey" wrote:

    > One way:
    >
    > =SUMPRODUCT(--(A1:A1000=DATE(2005,9,1)),--(B1:B1000="A"))
    >
    > Or if months:
    >
    > =SUMPRODUCT(--(MONTH(A1:A1000)=9),(B1:B1000="A"))
    >
    > In article <[email protected]>,
    > "Judy" <[email protected]> wrote:
    >
    > > I once knew this... how can I nest a COUNTIF statement within an IF
    > > statement? As in, If A:A = 9/1/2005 count B:B if = "A"
    > >
    > > (I'm trying to count the number of As, Bc, Cs, etc based on a large
    > > worksheet by months.
    > >
    > > Thanks!

    >


  66. #66
    JE McGimpsey
    Guest

    Re: IF STATEMEMNTS

    In article <[email protected]>,
    "Sandy Mann" <[email protected]> wrote:

    > Are you sure? Array fomulas for whole rows seem to work for me.


    No, I was incorrect.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1