+ Reply to Thread
Results 1 to 17 of 17

Excel formula to return a cell column and row heading

  1. #1
    Registered User
    Join Date
    07-27-2012
    Location
    South Africa
    MS-Off Ver
    Excel 365
    Posts
    44

    Lightbulb Excel formula to return a cell column and row heading

    Hi everyone,

    I'm stumped, I've created a table according to shelving in my store room for spares. What I want to do now is create a formula whereby if I enter the part number in a cell on sheet 1 for eg: 10ABC123, I want it in the next cell to search the table on sheet 2 for the part number and tell me the column name and row name i.e. Stand 2; Box 3; Shelf 4 - so by putting that part number in I will know exactly where to go in the storeroom to find that spare. Can anyone help with that formula? I have attached the spreadsheet to make more sense of what I'm trying to do.

    Raj Bin.xlsx

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Excel formula to return a cell column and row heading

    =INDEX(TABLES!A1:A26,MIN(IF(TABLES!A1:I26=B4,ROW(TABLES!A1:I26)))-MOD(MIN(IF(TABLES!A1:I26=B4,ROW(TABLES!A1:I26))),3)) & " " & INDEX(TABLES!A2:I2,MIN(IF(TABLES!A1:I26=B4,COLUMN(TABLES!A1:I26))))

    It's an array formula so confirm with ctrl+shift+enter.

    Based on DaddyLongLegs formula here;
    http://www.excelforum.com/excel-form...n-a-table.html

  3. #3
    Registered User
    Join Date
    07-27-2012
    Location
    South Africa
    MS-Off Ver
    Excel 365
    Posts
    44

    Re: Excel formula to return a cell column and row heading

    Thank you SO much! Perfect! Please add in the extra formula for the stand name?

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Excel formula to return a cell column and row heading

    =index(tables!1:1,min(if(tables!a1:i26=b4,column(tables!a1:i26)))-mod(min(if(tables!a1:i26=b4,column(tables!a1:i26)))+6,8))&" "&index(tables!a2:i2,min(if(tables!a1:i26=b4,column(tables!a1:i26))))&" "&index(tables!a1:a26,min(if(tables!a1:i26=b4,row(tables!a1:i26)))-mod(min(if(tables!a1:i26=b4,row(tables!a1:i26))),3))

  5. #5
    Registered User
    Join Date
    07-27-2012
    Location
    South Africa
    MS-Off Ver
    Excel 365
    Posts
    44

    Re: Excel formula to return a cell column and row heading

    Thanks, it gives me a #VALUE though?

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Excel formula to return a cell column and row heading

    Did you use ctrl+shift+enter?

  7. #7
    Registered User
    Join Date
    07-27-2012
    Location
    South Africa
    MS-Off Ver
    Excel 365
    Posts
    44

    Re: Excel formula to return a cell column and row heading

    Oh yes I forgot about that! Thanks SO much for your help! You're a superstar!!!!!

  8. #8
    Registered User
    Join Date
    07-27-2012
    Location
    South Africa
    MS-Off Ver
    Excel 365
    Posts
    44

    Cool Re: Excel formula to return a cell column and row heading

    I should have done this earlier, if I added another 4 tables below that one (for 5 stands) how would the formula change? I've attached the new spreadsheet:

    Raj Bin.xlsx

  9. #9
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Excel formula to return a cell column and row heading

    Sorry, I was assuming the different stands would be horizontal. To find the stand as you have it would be:
    INDIRECT("Tables!B" & MIN(IF(TABLES!A1:I130=B4,ROW(TABLES!A1:I130)))+1-MOD( 26+MIN(IF(TABLES!A1:I130=B4,ROW(TABLES!A1:I130))),26))

  10. #10
    Registered User
    Join Date
    07-27-2012
    Location
    South Africa
    MS-Off Ver
    Excel 365
    Posts
    44

    Re: Excel formula to return a cell column and row heading

    It doesn't work for me is there supposed to be an = before INDIRECT? Even if i try it that way it doesn't want to work for me. I don't mind either way, if I put the tables side by side horizontally that would also be fine, how would I alter the formula then?

  11. #11
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Excel formula to return a cell column and row heading

    =INDIRECT("Tables!B" & MIN(IF(TABLES!A1:I130=B4,ROW(TABLES!A1:I130)))+1-MOD( 26+MIN(IF(TABLES!A1:I130=B4,ROW(TABLES!A1:I130))),26)) &" "&INDEX(TABLES!A2:I2,MIN(IF(TABLES!A1:I130=B4,COLUMN(TABLES!A1:I130))))&" "&INDEX(TABLES!A1:A130,MIN(IF(TABLES!A1:I130=B4,ROW(TABLES!A1:I130)))-MOD(MIN(IF(TABLES!A1:I130=B4,ROW(TABLES!A1:I130)))+ROUNDDOWN(MIN(IF(TABLES!A1:I130=B4,ROW(TABLES!A1:I130)))/27,0),3))

    Try that one, there were some problems in the shelf formula, I didn't notice you had groups of 2 and 3 cells in the row headers

  12. #12
    Registered User
    Join Date
    07-27-2012
    Location
    South Africa
    MS-Off Ver
    Excel 365
    Posts
    44

    Re: Excel formula to return a cell column and row heading

    YES!!!!!! Thank you so much! You're a DARLING!!!!

  13. #13
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Excel formula to return a cell column and row heading

    Not a problem, that one was interesting and I learnt a lot - I'm sure some of the more formula-orientated posters here could come up with something a bit shorter though!

  14. #14
    Registered User
    Join Date
    07-27-2012
    Location
    South Africa
    MS-Off Ver
    Excel 365
    Posts
    44

    Re: Excel formula to return a cell column and row heading

    Haha, doesn't phase me really how long the formula is, as long as it works thanks again! You've made my day! Nothing like that feeling when a formula works :D

  15. #15
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Excel formula to return a cell column and row heading

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  16. #16
    Registered User
    Join Date
    07-27-2012
    Location
    South Africa
    MS-Off Ver
    Excel 365
    Posts
    44

    Red face Re: Excel formula to return a cell column and row heading

    Hi there,

    Sorry to worry you again, but I've opened up my spreadsheet and it doesn't seem to be working again for some strange reason? Its only showing the stand and box number, not the shelf number? I have added in another shelf as well for the last stand. I'd really appreciate your help again

  17. #17
    Registered User
    Join Date
    07-27-2012
    Location
    South Africa
    MS-Off Ver
    Excel 365
    Posts
    44

    Wink Re: Excel formula to return a cell column and row heading

    Raj Bin.xlsx

    Sorry forgot to attached the spreadsheet. Also can you make it so it shows the stand #, the shelf # and then the box #?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 7
    Last Post: 01-25-2013, 05:17 PM
  2. Return Heading of Column with Maximum Value
    By eugp87 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-15-2012, 07:44 PM
  3. Replies: 6
    Last Post: 12-15-2012, 05:15 AM
  4. Formula to return column heading dependent on number in cell
    By Reidm in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-31-2008, 05:04 AM
  5. Formula to Return Column Heading
    By den4673 in forum Excel General
    Replies: 4
    Last Post: 02-13-2006, 06:00 PM

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