0

I made two excel sheet. one contains information as below

Date            Name            Quantity
12/7/2013   Bharat Sapte        12
12/7/2013   Ghorpade            10
14/7/2013   Desmukh             30
17/7/2013   Ghorpade            35

and for second sheet

Name         Date            Date
             12/07/2013
Ghorpade     _**_            _**__

here in ** marked area it should check the condition with first sheet and automatically fill up the Quantity in second sheet

how to make this program for too many entries.

3
  • 8
    This sounds like a pivot table job... Commented Jul 26, 2013 at 9:34
  • pivot table would be the best method, as @Passerby mentions. Pivot on Name as row header, Date as Column header, and quantity as the value. Simple as that. Commented Jul 26, 2013 at 13:23
  • I see no correlation between the title of the question and what you are asking ... if you're not happy with the comments above (Pivot) or the answer provided (VLOOKUP), please reformulate your question so that it becomes clear where in VBA you are stuck. Commented Jul 29, 2013 at 11:00

1 Answer 1

1

As said in the comments to your question, a Pivot table could do the job. A somewhat more static approach is to

  1. create a "key column" as a string concatenation of date & name before the Quantity column (can be hidden)
  2. use a =VLOOKUP(...) function to retrieve the quantity whereby the search argument is constructed from dates (column headers) and names (row headers) of the result table

screenshot

The formulas in B9 and B10 are

  • B9: =VLOOKUP(B$8&$A9;$C$2:$D$5;2;FALSE)
  • B10: =VLOOKUP(C$8&$A9;$C$2:$D$5;2;FALSE)

Mind the usage of $ to make rows (date) and columns (name) absolute to make copying easy; and replace my ";" by "," in the formulas if you use the English locale.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.