Results 1 to 6 of 6

Thread: =$B2 not working how I expect
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Aug 2019
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default =$B2 not working how I expect

    I'm not really sure what to call my problem, probably something very easy to look up if I knew what to call this.

    I have a sheet where column and row labels are the same values in the same order (B column is Mike, 2 row is Mike, C column is Suzy, 3 row is Suzy...). So B3 (Mike x Suzy) should be the same value as C2 (Mike x Suzy). If I have B3 be the cell where I input value, and C2 "=B3", fine. Problem is dragging that C2 formula down the 2 row... should end up with D2 =B4, E2 =B5, F2 =B6, etc etc. Doesn't want to do that. Starting off with C2 "=$B3" doesn't work either, dragging that is just pulling " = $B3" everywhere even though the $ should only be locking column reference?

    What am I missing?

  2. #2
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    41,416
    Post Thanks / Like
    Mentioned
    100 Post(s)
    Tagged
    21 Thread(s)

    Default Re: =$B2 not working how I expect

    Welcome to the MrExcel board!

    Is this, copied to the right what you are looking for?

    Transpose

    ABCDE
    1 MikeSuzyKenAnn
    2Mike xx abc
    3Suzyxx
    4Ken
    5Annabc

    Spreadsheet Formulas
    CellFormula
    C2=INDEX($B2:$B5,COLUMNS($B2:C2))&""


    Excel tables to the web >> Excel Jeanie HTML 4
    Hope this helps, good luck.
    Peter
    Excel 365 - Windows 10
    - Want to help your helpers by posting a small, copyable, screen shot directly in your post? Look here
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the # key in the Reply window
    - Read: Forum Rules, Forum Use Guidelines, & FAQ

  3. #3
    New Member
    Join Date
    Aug 2019
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: =$B2 not working how I expect

    Woof, that works, for generating all the "Mike x Suzy etc" stuff in row 2, but I don't really understand what the "COLUMNS($B2:C2)" and " &"" " is doing. I tried to guess that I would step down to "Suzy x Ken etc" with =INDEX($C3:$C5,COLUMNS($C3:D3))&"" things don't quite work the same?

  4. #4
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    41,416
    Post Thanks / Like
    Mentioned
    100 Post(s)
    Tagged
    21 Thread(s)

    Default Re: =$B2 not working how I expect

    Quote Originally Posted by Chicken Champ View Post
    Woof, that works, for generating all the "Mike x Suzy etc" stuff in row 2, but I don't really understand what the "COLUMNS($B2:C2)" and " &"" " is doing. I tried to guess that I would step down to "Suzy x Ken etc" with =INDEX($C3:$C5,COLUMNS($C3:D3))&"" things don't quite work the same?
    If you put your suggested formula in D3 in the above layout (that is, the first cell to the right of the diagonal in row 3) then it works for me.

    Transpose

    ABCDE
    1 MikeSuzyKenAnn
    2Mike xx abc
    3Suzyxx S-KS-A
    4Ken S-K
    5AnnabcS-A

    Spreadsheet Formulas
    CellFormula
    D3=INDEX($C3:$C5,COLUMNS($C3:D3))&""


    Excel tables to the web >> Excel Jeanie HTML 4

    Another option would be to keep referring to rows 2:5 and keep counting the columns from column B like this

    Transpose

    ABCDE
    1 MikeSuzyKenAnn
    2Mike xx abc
    3Suzyxx S-KS-A
    4Ken S-K
    5AnnabcS-A

    Spreadsheet Formulas
    CellFormula
    D3=INDEX($C2:$C5,COLUMNS($B2:D2))&""


    Excel tables to the web >> Excel Jeanie HTML 4
    Hope this helps, good luck.
    Peter
    Excel 365 - Windows 10
    - Want to help your helpers by posting a small, copyable, screen shot directly in your post? Look here
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the # key in the Reply window
    - Read: Forum Rules, Forum Use Guidelines, & FAQ

  5. #5
    New Member
    Join Date
    Aug 2019
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: =$B2 not working how I expect

    Oh I see, "COLUMNS($x:y)" is just counting number of columns and using that number to reference a row, a way of saying if you're in the second column look at the second row, etc. I still have no idea what the &"" does, but I think I've got enough to at least finish building my table.

    Thank you very much!

  6. #6
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    41,416
    Post Thanks / Like
    Mentioned
    100 Post(s)
    Tagged
    21 Thread(s)

    Default Re: =$B2 not working how I expect

    Quote Originally Posted by Chicken Champ View Post
    Oh I see, "COLUMNS($x:y)" is just counting number of columns and using that number to reference a row, a way of saying if you're in the second column look at the second row, etc.
    Exactly.

    Quote Originally Posted by Chicken Champ View Post
    I still have no idea what the &"" does,
    If you don't have that and any cells in the bottom left section of the table are blank the formula would return a zero (0) instead of blank. I have taken the &"" of the end of this cell's formula for example.

    Transpose

    ABCDE
    1 MikeSuzyKenAnn
    2Mike xx0abc
    3Suzyxx S-KS-A
    4Ken S-K
    5AnnabcS-A

    Spreadsheet Formulas
    CellFormula
    D2=INDEX($B2:$B5,COLUMNS($B2:D2))


    Excel tables to the web >> Excel Jeanie HTML 4
    Hope this helps, good luck.
    Peter
    Excel 365 - Windows 10
    - Want to help your helpers by posting a small, copyable, screen shot directly in your post? Look here
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the # key in the Reply window
    - Read: Forum Rules, Forum Use Guidelines, & FAQ

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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