Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default using vells that fulfill a certain criteria

Hi guys,

I have the following problem.

I have a database of contracts of my clients. I want to have a certain
tool that gives me all the contracts that come to end in 2006,2007,....
The contract end date is specified in the database, so this isn't the
problem.

So, it would something like
'if maturity date is less than one year then report the value of the
contract in the column 2006'
'if ..... 2years
2007'


and so until 2010.


somebody an idea??

thankx

mat

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default using vells that fulfill a certain criteria

You appear to have a contradiction in your requirement. You state contracts
which end in 2006, 2007 etc ..but then say 'if maturity date is less than one
year ' so under the latter a contract ending 31 Jan 2007 would be in 2006
category as its maturity date is less than one year from now.

Are you simply wanting to list contracts with an end date in a given year so
all we (you) need to do is test the YEAR of the contract end date and list in
appropriate column?

How do you want the ouput formatted?

"matthias" wrote:

Hi guys,

I have the following problem.

I have a database of contracts of my clients. I want to have a certain
tool that gives me all the contracts that come to end in 2006,2007,....
The contract end date is specified in the database, so this isn't the
problem.

So, it would something like
'if maturity date is less than one year then report the value of the
contract in the column 2006'
'if ..... 2years
2007'


and so until 2010.


somebody an idea??

thankx

mat


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default using vells that fulfill a certain criteria

You are right, i just want to list contracts with an end date in 2006
in the column 2006 and so on

about the output,

so i would like to have columns from 2006 to 2010. all the contracts
that end in 2006 are listed in 2006,...

from these contracts that fall e.g. under the column 2006, I would like
to list the name of the person and the contract value. (would this be
with a lookup funtion or so)

sorry if I am not being clear... but just ask me and i will try to make
it clearer

thanks a lot

mat

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default using vells that fulfill a certain criteria

.... So output is two columns per year ?:


2006 2007 etc
Name Value Name Value
col 1 col 2 col 3 col 4 ....

What are the columns for your input i.e date, name and value and are they
sorted/can they be sorted e.g. by date?

Thanks.


"matthias" wrote:

You are right, i just want to list contracts with an end date in 2006
in the column 2006 and so on

about the output,

so i would like to have columns from 2006 to 2010. all the contracts
that end in 2006 are listed in 2006,...

from these contracts that fall e.g. under the column 2006, I would like
to list the name of the person and the contract value. (would this be
with a lookup funtion or so)

sorry if I am not being clear... but just ask me and i will try to make
it clearer

thanks a lot

mat


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default using vells that fulfill a certain criteria

let me be more specific

e.g.
contracts end term value
client 1 5/2006 1000
client 2 6/2007 2000

so if want this

2006 2007
client 1 1000 client2 2000

the clients can be sorted by name



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default using vells that fulfill a certain criteria

Hi,
Try this ... no sorting.

Sub a()

Dim ws1 As Worksheet, ws2 As Worksheet
Dim lastrow As Long, r As Long
Dim baseyear As Integer, i As Integer, yy As Integer, icol As Integer

Set ws1 = Worksheets("Sheet1")
Set ws2 = Worksheets("Sheet2")

baseyear = Year(Date)

With ws2
.Cells.ClearContents
For i = 1 To 5 ' Set for 5 years
.Cells(1, (i - 1) * 2 + 1) = baseyear + i - 1
.Cells(2, (i - 1) * 2 + 1).Resize(1, 2) = Array("Client", "Value")
Next i
End With

With ws1
lastrow = .Cells(Rows.Count, "A").End(xlUp).Row
For r = 2 To lastrow
yy = Year(.Cells(r, 2))
icol = (yy - baseyear) * 2 + 1
ws2.Cells(Rows.Count, icol).End(xlUp)(2) = .Cells(r, "A")
ws2.Cells(Rows.Count, icol + 1).End(xlUp)(2) = .Cells(r, "C")
Next r
End With

End Sub

HTH

"matthias" wrote:

let me be more specific

e.g.
contracts end term value
client 1 5/2006 1000
client 2 6/2007 2000

so if want this

2006 2007
client 1 1000 client2 2000

the clients can be sorted by name


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count how many criteria in a column match criteria in another colu Charles Stover Excel Discussion (Misc queries) 3 March 6th 09 08:39 PM
EXCEL - Meet 2 criteria, then find next case of third criteria Elaine Excel Worksheet Functions 3 December 1st 08 10:43 PM
Counting Cells with multiple criteria.One criteria supporting wild Azhar Saleem Excel Worksheet Functions 1 January 12th 05 10:54 AM
Counting Cells with multiple criteria.One criteria supporting wild Azhar Arain Excel Worksheet Functions 1 January 12th 05 08:33 AM
have input box. Need criteria entered to refer to cond. format criteria Bob Phillips[_6_] Excel Programming 0 March 1st 04 08:17 PM


All times are GMT +1. The time now is 03:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"