Solved

Lookup with count

Posted on 2011-03-13
2
224 Views
Last Modified: 2012-06-21
Dear experts,

Need a formulae, which will populate data from the sheet 'data' in to this sheet.

Sheet 'data' has two columns, variable and value.

The data under variable repeats and values are unique

In the sheet 'report' the variable is produced in column A, and the values are to placed adjacent one after the other, that the count 1 record is in column B(header count 1), and second count value in column C (header count 2) and so on.

If there is no variable, I need the formulae to leave the value in the cell to blank.

Kindly provide me an excel formulae, which can provide me the above soluation.

Thank you,

lookup-with-count.xls
0
Comment
Question by:Excellearner
2 Comments
 
LVL 24

Assisted Solution

by:StephenJR
StephenJR earned 100 total points
ID: 35121982
Try this in B2 and copied down and across. Array formula so enter with Ctrl+Shift+Enter:

=IF(COLUMNS($B$2:B2)<=COUNTIF(Data!$A$2:$A$13,$A2),INDEX(Data!$B$2:$B$13,SMALL(IF(Data!$A$2:$A$13=$A2,ROW($A$2:$A$13)-ROW($A$2)+1),COLUMNS($B$2:B2)),1),"")
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 400 total points
ID: 35122515
Stephen's formula is the best approach for data in any order....but if you have the variables in Data!A:A in blocks as per your example then you could use a simplified version, i.e. in B2 copied across and down

=IF(COLUMNS($B2:B2)>COUNTIF(Data!$A:$A,$A2),"",INDEX(Data!$B:$B,MATCH($A2,Data!$A:$A,0)+COLUMNS($B2:B2)-1))

regards, barry
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Vlookup for in-between dates 4 38
VBA Help 18 44
Excel VBA 4 26
Creating An Intelligent Dropdown 8 28
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question