+ Reply to Thread
Results 1 to 9 of 9

&

  1. #1
    HGood
    Guest

    &

    A month or two ago some kind person here provided a formula for me. I've had
    to change some things but there's a part of the formula I don't understand
    and I can't find any help in my book or in Help or online.

    It is (countifM4,A1:A10&""). This is only a portion of the overall formula,
    but what does the & mean?

    I think the "" just means blank, but how does the & tie it to the A1:A10
    range?

    Thanks for any help you can offer.

    Harold



  2. #2
    Bob Phillips
    Guest

    Re: &

    Without seeing the whole formula, it is a bit guessing, but the &
    concatenates two elements, so this is adding "" to the cells A1:A10.
    Normally, this is used to stop empty cells causing the formula to fail.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "HGood" <[email protected]> wrote in message
    news:[email protected]...
    > A month or two ago some kind person here provided a formula for me. I've

    had
    > to change some things but there's a part of the formula I don't understand
    > and I can't find any help in my book or in Help or online.
    >
    > It is (countifM4,A1:A10&""). This is only a portion of the overall

    formula,
    > but what does the & mean?
    >
    > I think the "" just means blank, but how does the & tie it to the A1:A10
    > range?
    >
    > Thanks for any help you can offer.
    >
    > Harold
    >
    >




  3. #3
    Harlan Grove
    Guest

    Re: &

    "Bob Phillips" <[email protected]> wrote...
    >Without seeing the whole formula, it is a bit guessing, but the &
    >concatenates two elements, so this is adding "" to the cells A1:A10.
    >Normally, this is used to stop empty cells causing the formula to fail.

    ....

    And it does so by assuring that blank cells would be treated as "" rather
    than as 0 (or Empty).



  4. #4
    HGood
    Guest

    Re: &

    Thanks, this helps, now I need to dig in and see what it actually does in
    this situation.

    This is very helpful. Thanks so much.

    Harold


    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    > "Bob Phillips" <[email protected]> wrote...
    >>Without seeing the whole formula, it is a bit guessing, but the &
    >>concatenates two elements, so this is adding "" to the cells A1:A10.
    >>Normally, this is used to stop empty cells causing the formula to fail.

    > ...
    >
    > And it does so by assuring that blank cells would be treated as "" rather
    > than as 0 (or Empty).
    >
    >




  5. #5
    Arvi Laanemets
    Guest

    Re: &

    Hi

    Another possible explanation - it converts data, referred to in column A, to
    strings. I use it myself sometimes, because Excel tends sometimes to
    interprete refernces to numeral strings (in range formatted as text) as
    numbers. Lately I had such a case with VLOOKUP function.


    Arvi Laanemets


    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    > "Bob Phillips" <[email protected]> wrote...
    > >Without seeing the whole formula, it is a bit guessing, but the &
    > >concatenates two elements, so this is adding "" to the cells A1:A10.
    > >Normally, this is used to stop empty cells causing the formula to fail.

    > ...
    >
    > And it does so by assuring that blank cells would be treated as "" rather
    > than as 0 (or Empty).
    >
    >




  6. #6
    Harlan Grove
    Guest

    Re: &

    Arvi Laanemets wrote...
    >Another possible explanation - it converts data, referred to in column

    A, to
    >strings. I use it myself sometimes, because Excel tends sometimes to
    >interprete refernces to numeral strings (in range formatted as text)

    as
    >numbers. Lately I had such a case with VLOOKUP function.

    ....

    Yes, but it's a meaningless conversion *EXCEPT* for blank cells. Put 0
    (number) in A1 and ="0" (numeric string) in A2. Make sure cell IV65536
    is blank. Then enter the formulas

    =COUNTIF(A1:A2,0)

    =COUNTIF(A1:A2,"0")

    =COUNTIF(A1:A2,IV65536)

    Do they all return 2? On the other hand, the formula

    =COUNTIF(A1:A2,IV65536&"")

    should return 0.

    COUNTIF's (and SUMIF's) second argument is always interpreted as a
    string, BUT it appears this is only done inside the COUNTIF (and SUMIF)
    functions. Excel passes these functions the second argument, but it
    appears Excel converts blank cells in the second argument into numeric
    zeros. This really looks like a bug that's become a 'feature' since
    LEN(IV65536) returns 0 rather than 1, so there *ARE* Excel functions
    that treat blank cell arguments as "" rather than 0, but the Excel
    developers seem not to have applied the same type handling of COUNTIF's
    (and SUMIF's) second argument as they did for LEN's argument. Want to
    start a pool on how many years it'll take Microsoft to fix this?


  7. #7
    HGood
    Guest

    Re: &

    Wow, this is an education into places I haven't been before, but very
    helpful.

    Thanks,

    Harold


    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    > Arvi Laanemets wrote...
    >>Another possible explanation - it converts data, referred to in column

    > A, to
    >>strings. I use it myself sometimes, because Excel tends sometimes to
    >>interprete refernces to numeral strings (in range formatted as text)

    > as
    >>numbers. Lately I had such a case with VLOOKUP function.

    > ...
    >
    > Yes, but it's a meaningless conversion *EXCEPT* for blank cells. Put 0
    > (number) in A1 and ="0" (numeric string) in A2. Make sure cell IV65536
    > is blank. Then enter the formulas
    >
    > =COUNTIF(A1:A2,0)
    >
    > =COUNTIF(A1:A2,"0")
    >
    > =COUNTIF(A1:A2,IV65536)
    >
    > Do they all return 2? On the other hand, the formula
    >
    > =COUNTIF(A1:A2,IV65536&"")
    >
    > should return 0.
    >
    > COUNTIF's (and SUMIF's) second argument is always interpreted as a
    > string, BUT it appears this is only done inside the COUNTIF (and SUMIF)
    > functions. Excel passes these functions the second argument, but it
    > appears Excel converts blank cells in the second argument into numeric
    > zeros. This really looks like a bug that's become a 'feature' since
    > LEN(IV65536) returns 0 rather than 1, so there *ARE* Excel functions
    > that treat blank cell arguments as "" rather than 0, but the Excel
    > developers seem not to have applied the same type handling of COUNTIF's
    > (and SUMIF's) second argument as they did for LEN's argument. Want to
    > start a pool on how many years it'll take Microsoft to fix this?
    >




  8. #8
    Arvi Laanemets
    Guest

    Re: &

    Hi


    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    > Arvi Laanemets wrote...
    > >Another possible explanation - it converts data, referred to in column

    > A, to
    > >strings. I use it myself sometimes, because Excel tends sometimes to
    > >interprete refernces to numeral strings (in range formatted as text)

    > as
    > >numbers. Lately I had such a case with VLOOKUP function.

    > ...
    >
    > Yes, but it's a meaningless conversion *EXCEPT* for blank cells. Put 0
    > (number) in A1 and ="0" (numeric string) in A2. Make sure cell IV65536
    > is blank. Then enter the formulas
    >
    > =COUNTIF(A1:A2,0)
    >
    > =COUNTIF(A1:A2,"0")
    >
    > =COUNTIF(A1:A2,IV65536)
    >
    > Do they all return 2? On the other hand, the formula
    >
    > =COUNTIF(A1:A2,IV65536&"")
    >
    > should return 0.
    >
    > COUNTIF's (and SUMIF's) second argument is always interpreted as a
    > string, BUT it appears this is only done inside the COUNTIF (and SUMIF)
    > functions. Excel passes these functions the second argument, but it
    > appears Excel converts blank cells in the second argument into numeric
    > zeros. This really looks like a bug that's become a 'feature' since
    > LEN(IV65536) returns 0 rather than 1, so there *ARE* Excel functions
    > that treat blank cell arguments as "" rather than 0, but the Excel
    > developers seem not to have applied the same type handling of COUNTIF's
    > (and SUMIF's) second argument as they did for LEN's argument. Want to
    > start a pool on how many years it'll take Microsoft to fix this?


    OK. Because the formula in state it was presented (countifM4,A1:A10&"")
    didn't have any meaning, I missed that it had to be something based on
    COUNTIF. So my post was about formulas in general. A couple of examples with
    VLOOKUP here

    A1:A3 contains numbers (format General) 1, 2, 3
    B1:B3 contains charctes "A", "B", "C"
    C1 (Text) contains numeric string "2"
    The formula
    =VLOOKUP(C1,A2:B3,2,0)
    (as regular one so array formula) returns "#N/A"
    {=VLOOKUP(C1,(A2:B3)&"",2,0)}
    returna "B"

    The same setup, but A1:A3 is formatted as Text, and C1 as General (all
    values re-entered of-course)
    =VLOOKUP(C1,A2:B3,2,0)
    returns "#N/A" again
    =VLOOKUP(C1&"",A2:B3,2,0)
    (regular formula) returns "B"

    Those above are of-course simplified examples. With single-type direct
    entries you can avoid such problems. But sometimes those numeric strings are
    results of some formulas, i.e. you can't format the cell as text. And some
    entries are there texts, and some numeric strings - even when you force the
    result to be string (MyFormula&""), and it behaves as string (without
    alignment is left-aligned), in references it is sometimes interpreted as
    number.


    Arvi Laanemets



  9. #9
    Harlan Grove
    Guest

    Re: &

    Arvi Laanemets wrote:
    ....
    >A1:A3 contains numbers (format General) 1, 2, 3
    >B1:B3 contains charctes "A", "B", "C"
    >C1 (Text) contains numeric string "2"
    >The formula
    >=VLOOKUP(C1,A2:B3,2,0)
    >(as regular one so array formula) returns "#N/A"
    >{=VLOOKUP(C1,(A2:B3)&"",2,0)}
    >returna "B"

    ....

    If there's a mix of text and numbers in the first column of the table,
    a bit of data cleansing would make more sense, but it'd be much more
    efficient to use the array formula

    =INDEX(A2:B3,MATCH(C1&"",A2:A3&"",0),2)

    Besides, forcing the second and possibly subsequent columns of the
    table to be strings as well could result in incorrect return values.

    However, if the first column of the table is all of the same type, then
    the lookup value alone should be coerced to the type of the first
    column in the table.

    =VLOOKUP(--C1,A2:B3,2,0)


+ 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