Lookup Column Header Value Based On Matching Table Value

May 16, 2013

I'd like a formula that'll return the column header by matching a lookup value with a table in the second sheet.

eg: sheet 1



[Code] .......

The formula should match the name in A2, John, with value from the table in sheet 2 and return the correct region, this case North.

View 1 Replies


VBA Code To Copy And Paste To Specific Rows Based On Matching Column Header?

Dec 7, 2011

I have a spreadsheet and I was wondering if there is a way to copy from a specific range in say A1:A5 in Sheet1 and paste into Sheet2 where the column matches cell A1 in Sheet1.

I am trying to do this in VBA and I was wondering if there is a way to do this.

View 9 Replies View Related

Dynamic Lookup Based On Column Header

Jun 21, 2013

I'm trying to calculate a figure in a report tab that reads off the data tab and looks for a specific column based on the header of that column. My explanation is admittedly poor but I've attached a sample file with an outline of what I'm trying to do which I hope makes things clearer.

Sample File.xlsx

View 2 Replies View Related

Lookup Column Header Based On Cell Value

Aug 11, 2009

I have a spreadsheet an excerpt of which is as follows:

1 Doors Security Vehicle Key

Want I want to happen is to return the column header where there for a cell which contains "TRUE" in a blank column. If there isn't a cell with the value "TRUE" then to return "N/A". In the above example in blank column P for Row 2 would be "Doors", Row 3 would be "Security,Vehicle" and Row 4 would be "N/A".

In my actual spreadsheet I have 12 columns (L to W) which have the TRUE or FALSE values.

I know it has something to do with either HLOOKUP, INDEX and MATCH but can't seem to get it right. Any ideas?

View 4 Replies View Related

Lookup On Column And Row Header

Feb 9, 2010

I need a formula to lookup and retrieve data from a table of values. Given an EMP-ID in column A of the row that contains the formula and given a column name in row 1 of the column that contains the formula, I need to do a lookup. So, in effect, I am doing a lookup based on two values .. the column header and the row header.

I have attached a small model to illustrate what I need. Cell C-3 in the first worksheet will contain the formula to lookup and retrieve the value in cell C-7 in the second worksheet, based on the values in cell C-1 (column header = “Database Col 2”) and in cell A-3 (row header = “257”) in the first worksheet.

View 2 Replies View Related

Lookup Column Header Value When First Cell Is Populated In Row?

Feb 6, 2009

Basically i have a manpower chart with months along the top and names down the far left. People are going to start work in different months so i want to know at the side of each persons name the month they start. Heres a simple example

I have column headers starting at B1 thru F1, with the following values Month1,Month2,Month3,Month4,Month5
In cell D2 i have the value 1
I want Cell A2 to return the value Month3

Whats the formula i need to input in A2

View 9 Replies View Related

VBA - Lookup For Value In A Range And Returns Its Column Header

Jan 16, 2014

I have a table (A1:C5)

A1:C1 contain the table headers
A2:C5 contain the data
A6 contains the value I want to search for I use this formula to return the column header of A6 A6=INDEX(A1:C1,SUMPRODUCT((A2:C5=A6)*COLUMN(A2:C5))) Now, if there are duplicate values in A2:C5, this will return more than one column header What I need is a vba code to view a msgbox with all column headers returned in this case

View 1 Replies View Related

Lookup Column Header Value When First Cell Is Populated In A Row

Feb 6, 2009

i have a manpower chart with months along the top and names down the far left. People are going to start work in different months so i want to know at the side of each persons name the month they start. Does that make sense? Heres a simple example

I have column headers starting at B1 thru F1, with the following values Month1,Month2,Month3,Month4,Month5
In cell D2 i have the value 1
I want Cell A2 to return the value Month3

Whats the formula i need to input in A2

View 9 Replies View Related

Lookup Row & Column Heading To Return Corresponding Header

Nov 18, 2008

I have a list of names and the chores they need to do on a certain day. I need a formula that returns the chore the person needs to do when the date is filled in.

Ex: Sheet2 Col:A has names filled in A2:11 , row B1:J1 has dates that you would input.
formula goes in B2:J11
Sheet1 is the master with all the data the formula would be pulling from.
column A2:A11 has the names , row B1:S1 has the chore that needs to be done.
B2:S11 has the dates already filled in.

View 5 Replies View Related

Table Manipulation Based On Header And Details Tables?

May 19, 2014

I have a table which is extracted from a database using 2 tables.

1 Header and 1 details table.

I want to display the latest date in column E.

As Column A,B,C is the header table and column D,E is the details table.

Can this be done in vba or a pivot?

View 1 Replies View Related

Recognizing Column Header In Table As Date?

Sep 29, 2013

Perhaps I missed something in the basics of Excel as to how a table's column header is formatted.Also, my date format is dd/mm/yyyy

When using a basic formula, such as below, in A1 and Cells A2 and B2 have the dates 1/01/2013 and 2/01/2013, this code works fine.

VB : =If(A2<=Today(),"Yes";"No")

BUT, when you convert those two dates to a table, the formula with post No.

However, if you make another formula as show below, the correct day will come up.

VB : =Text(A2,"dddd")

When auto filling the dates in the row, without a table, the dates increase per day.

When auto filling the dates in the row, with a table, the dates increase per year. (And yes, even when 3+ dates are inserted, highlighting those 3 and then autofill.)

Why does a column header change the format and to what format is it changed to?

Why do some formulas output accurate date based on the date in the column header and others do not?

Why do the dates increase per day without a table and per year with a table?

View 3 Replies View Related

Find Value In Table & Return Column / Row Header

Nov 23, 2009

I am having trouble with getting a value (which is the row and column value) from a set of numbers. I have attached an example table to try and make things clearer.
What I have is a table with a set of Row Headers, and Columns Headers all numeric. e.g Columns headed 1, 2, 3, 4, Rows 30, 40, 50 etc. I want to find the 1st occurrence of a value e.g. 1.0 in the table (by 1st Up mean closest to top left), and then give me the value of the Row and Column Header that corresponds to that.

So for the example attached, I want to get the row Value 200 and Column 6 from finding the 1st occurrence of the number 1. I have tried various combinations of index and Match etc. But I can't get my head around the fact that the position of the 1st no. 1.0 can change, therefore I can't use any releative positions etc.

View 3 Replies View Related

Pivot Table - How To Use Same Data For Filter And Column Header

May 13, 2014

I have a list of S/N with Pass/Fail result next to it. A specific S/N can appear several times in the list:


When creating a pivot table of SN vs. Result (count) I get:


I want to get the FAIL count of SN in which PASS > 0 (First two rows)

BUT I can not figure out how I can filter based on the values of the pivot table itself (rather than the values of the original list). When I try to use 'Result' field as report filter, I can not get it as a Column label (and vice-versa). In this case I get:

I get:
111 | ...1
222 | ...1


111 |...3...1
222 |........1

Desired (alternative):

111 |...3
222 |...0

View 1 Replies View Related

Two Page Lookup Matching Criteria Based On Cell Value

May 26, 2009

I have an items list on page 2. On page 1 I want to create a drop down menu in C2 that references the list on page 2. Then when I choose an item, I want the additional information in cells D2 and E2 to come in automatically. The list on page 2 will be expanding daily, and when I expand it I can simply insert a new row so I correctly alphabatize it instead of constantly having to resort it.

With that said....
1. How do you put in the drop down box that references information on a different sheet?

2. What is the best way to reference the information in my ever expanding situation: Index/Match, Vlookup, Lookup, or something I havent mentioned?

View 14 Replies View Related

Lookup Table (adjust Which Column The Lookup Function Refers To)

Jun 12, 2009

I am trying to perform a lookup (vlookup) function in a cell in excel and wish to have the range as a variable, so that I can adjust which column the lookup function refers to.

View 4 Replies View Related

Lookup In Another Sheet And Get Top Cell Data Of Matching Column

May 9, 2014

Private Sub GetColData()
Dim SrchRng As Range
Dim SrchVal As Range


And it is also possible by using Column Number to retrieve the data SrchTxt, which is in a cell in the Row, in which "Roy" is found. This Row in this example is Row 5. Column Number may be anything within the search Range. Column Number is 3 in this example.

In Sheet1 "Poet" is in C1. (SrchTxt)

How to retrieve data of the cell in Row 1 in the column where "Roy" is found?

View 1 Replies View Related

Return Column Header Based On Column Criteria And Number Value

Feb 7, 2014

I have the following sample data set and I'm trying to return the appropriate column header based on criteria (i.e. DDD) and a number value which will be somewhere within the range of the table. In example below, the value returned should be Header 2 because the value is greater than those in Header 1 column (range H9 to L26).

Here's data table:

CriteriaHeader 1Header 2Header 3Header 4

DDD10.00Header 1>>>=INDEX($I$9:$L$9,MATCH(I29,INDEX($I$10:$L$26,MATCH(H29,$H$10:$H$26),)))

View 3 Replies View Related

Return Value From Column Based On Header Value?

Jul 16, 2013

Cells A3:A500 contain product numbers, e.g. 1001, 1002, 1003 etc.. etc...
Cells G2:N2 are column headers, e.g. North2011, South2011, North2012, South2012 etc... etc...
Cell F2 is a lookup that will return a year, e.g. 2011, 2012, 2013 etc... etc...

Against each product is a "yes" if it was sold in the north or south region for each year. This could be both north and south, one or the other or none at all.

What I would like is a formula in cells E3:E500 that looks at the year in cell F2 and if there is a "yes" in either the North or South for that year to return "yes" otherwise blank.

I am unable to upload a sample document due to firewalls.

View 5 Replies View Related

Return Column Header Based On Row Value

Mar 11, 2014

Evaluation Results

Vendor Lowest Price
Vendor 2nd Lowest Price

[Code] .......

I have above table and wants to get the formula for getting the 1) Vendor Name of the Lowest Price per item 2) Vendor Name of the 2nd Lowest Price per item 3) and be able to copy down the formula for other items.

View 5 Replies View Related

Delete Column Based On Column Header

Apr 29, 2009

I have a spreadsheet with several columns (all column names are in row 1).

I have 2 of column names. Note that their actual column# might change so the macro would have to look for the column name and NOT the column position ...

View 11 Replies View Related

Looking Up Column Header Value Based On Color And Position In Row

Dec 12, 2009

I am trying to create a schedule using colors. The colors will indicate the start time, break time, lunch time, break time (second break) and end time. see attached document.

Thank you for attempting to solve this puzzle using formulas and or VBA code. I am trying to automate the schedule so the numerical times automatically appear when I "paint" the schedule.

View 5 Replies View Related

Lookup Up Entire Table Not Just Column In Table Like Vlookup Does

Jun 5, 2014

I'm trying to see if you can look up multi columns for a number and when it finds it return back to one column and return that data?

I am trying to sort out territories for a state I work on; the territories are divided up by zip codes.


territory 1 12345 54321 11222
territory 2 22222 33333
territory 3 44444 55555

and what I want is to say put a formula in cell B3 on Sheet 1 pointing to cell C3 that has zip code 33333. I want it to then take that and look in Sheet 2 and search A1:D3 and when it finds 33333, return "territory 2" back to cell B3 on Sheet 1.

View 3 Replies View Related

Selectively Copying Cells Based On Column Header?

Jul 9, 2013

I'm trying to copy cells from a column in one workbook to cells in a column in another workbook based on what's in a header column.

Such as

Original workbook
Mat Qty
A 1
C 3
D 2
E 4
G 5
Total 15

Target workbook becomes

Mat Qty -> Mat Qty
A -> A 1
B -> B
C -> C 3
D -> D 2
E -> E 4
F -> F
G -> G 5

My code so far (which might not be worth reading) is:

Sub CopyColumnToWorkbook()
Dim sourceColumn As Range, targetColumn As Range, sourceColumnValue As Range, targetColumnValue As Range
Dim mySourceCell As Range, myTargetCell As Range


I'm getting a runtime error ('1004'. Application-defined or object-defined error) on the Copy statement within the If sttement.

View 3 Replies View Related

Macro To Insert Formula Based On Column Header

Feb 24, 2009

I have to use several dozen pivot tables a day. I already use a couple of macros to do a lot of the tedious formatting, but if I could automate this it would save me a lot more time. I have been trying to both write a code and modify code written by the recorder but have not even come close to anything that works. What I want is to have a macro that searches through the column header for predefined names and if it comes across one of these names it will insert a specific formula, based on its name, in the first cell below the header. Then it will autofill to the last row and move on to searching for the next predefined header name. If that name is not found, it will move to the next predefined header name. One major problem is that the formula to insert under any specific header name is based on other columns in the table that aren't always in the same range. So, not only do I need it to search for columns to place a formula in, that formula has to search for the appropriate column to find the correct value to use in the calculation.

For example, one predefined column name would be Avg Price. The formula for that column would be (Sales/Qty Sold), but these 2 columns could be located anwhere in the table. How can I get it, once it has found a column that needs a formula, to locate the correct column/cell to get the correct value from the sales and Qty Sold columns?

View 9 Replies View Related

Fill Table Based On Matching Cell Values & Export

Dec 21, 2007

(refer to attached workbook)

For what I'd like to do, the attached workbook actually represents 2 or more workbooks. The 'Project-PO Report' tab is a sample of what will be several workbooks/reports that will be generated from the data in 'POTASK'.

The 'CMD_BUTTON' tab represents how I plan to use a command button " IMPORT DATA" to import the data into this workbook, then use "RUN PROJECT-PO-REPORT" to call the MACRO to achieve my objective,as stated below. (Originally,this workbook was about 8mb, so to get this under the size for attachment, I just copied the bare minimum of what I believe would be needed to assist me, and so there's no buttons or macros or dynamic name ranges, as there will be...)

Here's what I want to do: ...

View 3 Replies View Related

How To Get Header By Matching Value In Row

Dec 6, 2013

Attaching the excel (QOS- ARP- Applications.xlsx) - Formula I am trying in D27, "X" value is there in the row and the corresponding application (Header ) should be the return in D27.

View 1 Replies View Related

Delete Rows Based On Criteria While Referencing Column Header

Jun 6, 2007

I'm trying to use VBA code to delete certain rows based on a couple of criteria as follows:

1) If column header is "TERMINAL NAME" and the cell value in that column is "BONDDESK", I need the entire row deleted.

2) Similiarly, if the column header is "PRODUCT TYPE" and the cell value in that column is "CORP", that entire row needs deleted as well.

The information is coming from another source, so the columns may change from day to day, i.e, "TERMINAL NAME" may be in Column L one day but in Column O another day.....

View 6 Replies View Related

Convert Numbers To Postitive/Negative Based On Column Header

Mar 7, 2008

I have this data source file that comes from a back office program, and basically what i want it to do is to turn the number negative in column C when the header of that column in column A is WITHDR and leave it positive when it is CONTR. What i was thinking was that it could go to column A from column C and go up each cell until the cell is not a date and multiply the column C number by -1 depending the column A header equals WITHDR and do that for every cell in column C, but I dont know how to proceed, im new at VBA.

View 8 Replies View Related

Rearrange (sort) Columns Based On Number In Column Header String

Apr 3, 2014

I want to rearrange(sort asscending) columns based on numerical value in column header string through VBA macro. Please check attachment.

i.e. (Present Data)
# A B C D
1 col.1 col.4 col.3 col.2

(Output Data )
# A B C D
1 col.1 col.2 col.3 col.4


View 2 Replies View Related

VBA Loop Through Worksheet And Format Each Column As Text, Or Date Based On Header

Jun 30, 2006

I am trying to figure out a way to condense my code (improve my code) Right now I am using a Macro in Excel to go through a workbook by selecting each column individually and if there is something in the header then formatting that column as text. The problem with the way I am currently doing it, is that due to size limitations on the VBA code, I can only select columns A to Z, and if there is more data in the worksheet it is not formatted. Also I would like the code to check the header and if the word date is in there, format it as a date instead. Also if there is a way to delete any invalid ranges in the workbook

Sub Format()
Dim VarFileName As String
Dim VarPath As String
Dim VarSavein As String
Dim wsheet As Worksheet
VarSavein = Sheets("sheet1").Range("C2").Value
VarFileName = Sheets("sheet1").Range("A2").Value
VarPath = Sheets("sheet1").Range("B2").Value
Workbooks.Open VarPath & VarFileName
For Each wsheet In ActiveWorkbook.Worksheets
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:= Array(1, 2), TrailingMinusNumbers:=True..........................................

View 3 Replies View Related

Copyrights 2005-15 www.BigResource.com, All rights reserved