Solved

Lookup with count

Posted on 2011-03-13
2
220 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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
VBA to look in every sheet and 2 20
VLOOKUP to a Closed Workbook 22 61
Thanks for the advise, but... 4 24
TT Status Chang 3 27
Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now