ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If/Then Matrix? Can Excel do this? (https://www.excelbanter.com/excel-programming/305691-if-then-matrix-can-excel-do.html)

D[_6_]

If/Then Matrix? Can Excel do this?
 
Hey guys- got a semi-easy one here...

I have a range of dates that I need a specific code associated with each
year. For example- if the year is 1982, the code to use in this cell is
..9445. If the year is 1993, the code is .9669, and so on. This will run in a
macro eventually. How/where do I write this, and, can Excel do something
like this? IE- can Excel 'store' a 'matrix' of codes for each year? I hope
this is making sense.
Bbtw, it doesnt HAVE TO work in a macro- it'd be pretty cool if it could
actually work automatically as soon as the date was entered into a specific
cell, but a macro would work too... THANKS!
Thanks!
D





JE McGimpsey

If/Then Matrix? Can Excel do this?
 
One way:

Assume your matrix of dates and codes are in Sheet2, Cells A1:Bx, with
the dates in column A and codes in column B. Back in Sheet 1, assume the
entry cell is A1, then put this in B1:

=IF(A1<"",VLOOKUP(A1,Sheet2!A:B,2,FALSE))

In article <dajPc.21318$8G6.8418@fed1read04, "D" wrote:

I have a range of dates that I need a specific code associated with each
year. For example- if the year is 1982, the code to use in this cell is
.9445. If the year is 1993, the code is .9669, and so on. This will run in a
macro eventually. How/where do I write this, and, can Excel do something
like this? IE- can Excel 'store' a 'matrix' of codes for each year? I hope
this is making sense.
Bbtw, it doesnt HAVE TO work in a macro- it'd be pretty cool if it could
actually work automatically as soon as the date was entered into a specific
cell, but a macro would work too... THANKS!


D[_6_]

If/Then Matrix? Can Excel do this?
 
This did it! THANK YOU!!!
D

"JE McGimpsey" wrote in message
...
One way:

Assume your matrix of dates and codes are in Sheet2, Cells A1:Bx, with
the dates in column A and codes in column B. Back in Sheet 1, assume the
entry cell is A1, then put this in B1:

=IF(A1<"",VLOOKUP(A1,Sheet2!A:B,2,FALSE))

In article <dajPc.21318$8G6.8418@fed1read04, "D" wrote:

I have a range of dates that I need a specific code associated with each
year. For example- if the year is 1982, the code to use in this cell is
.9445. If the year is 1993, the code is .9669, and so on. This will run

in a
macro eventually. How/where do I write this, and, can Excel do something
like this? IE- can Excel 'store' a 'matrix' of codes for each year? I

hope
this is making sense.
Bbtw, it doesnt HAVE TO work in a macro- it'd be pretty cool if it could
actually work automatically as soon as the date was entered into a

specific
cell, but a macro would work too... THANKS!





All times are GMT +1. The time now is 12:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com