=$B2 not working how I expect

Chicken Champ

New Member
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?
 

Peter_SSs

MrExcel MVP, Moderator
Welcome to the MrExcel board!

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

Excel Workbook
ABCDE
1MikeSuzyKenAnn
2Mike abc
3Suzyxx
4Ken
5Annabc
Transpose
 

Chicken Champ

New Member
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?
 

Peter_SSs

MrExcel MVP, Moderator
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. :)

Excel Workbook
ABCDE
1MikeSuzyKenAnn
2Mikexxabc
3Suzyxx S-A
4KenS-K
5AnnabcS-A
Transpose


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

Excel Workbook
ABCDE
1MikeSuzyKenAnn
2Mikexxabc
3Suzyxx S-A
4KenS-K
5AnnabcS-A
Transpose
 

Chicken Champ

New Member
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!
 

Peter_SSs

MrExcel MVP, Moderator
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. :)

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.

Excel Workbook
ABCDE
1MikeSuzyKenAnn
2Mikexx abc
3SuzyxxS-KS-A
4KenS-K
5AnnabcS-A
Transpose
 

Some videos you may like

This Week's Hot Topics

  • Importing multiple excel files into one spreadsheet
    Hi, I'm trying to import multiple excel files (with the same format into a single spreadsheet) so that each day's file is listed underneath the...
  • find many based on a certain criteria
    good evening, I hope someone can help me? I have a workbook sheet 2 contains lots of data.... I would like to be able to find anything on sheet...
  • How to copy multiple rows using If
    Hi all, I'm very new to VBA and have written this simple code to copy certain cells if a certain cell within that row contains any data. I need...
  • VBA If statement
    Dear All, I have two dates, where I'd like a message box to pop, if the dates are between this criteria. [CODE] sDate1 = #10/1/2019#...
  • Text Format
    I have a sheet for user to keyin the data. The format of the data can be 451 / 1903, 0012 / 9908 or 00287 / 0099. The number after the "/" is...
  • Syntax errors
    Good Morning, Trying to compile a workbook, I keep getting a few errors. Here are the first two: [code=rich]Syntax Error: Function...
Top