How to Vary Date value and keep the rest Constant

nickysmithnicky

New Member
Joined
Jun 24, 2011
Messages
8
exceldateissue.html
Hi All

Would love your help with my following situation. I have been struggling with this for the last 3 days and have finally come close enough(or so I think!)


I have a reference table with columns as shown in TABLE A.
(DATE not= unique values and NUMBER not= unique values).

I want the result to look like TABLE B.

Based on the combined fields of the Date and Number(in table A), I want the corresponding

Amount value to be displayed in columns 1, 2 and 3(in table B).

I tried the following formula:

=INDEX($B$2:$B$10, MATCH(DATE(2010,1,1),$A$2:$A$10,0)*MATCH(J1, $C$2:$C$10,0))

The above works but just for one cell. I would like the DATE function to change(based on the date in column I) and keep the rest of the formula as it is.

Guys, am I even on the right track here ??

Any suggestions?
exceldateissue.html
 
Try this in K2 and Filled Right/Down to L6
=INDEX($C$2:$C$10,MATCH($J2&"|"&K$1,$B$2:$B$10&"|"&$D$2:$D$10,0))

It will be #N/A in K6 because there is no match for 1 and 1/5/2010

IMPORTANT
This is an array formula that required CTRL + SHIFT + ENTER
After entering formula in K2, Highlight K2 and press F2
Then press CTRL + SHIFT + ENTER
When entered correctly, the formula will be enclosed in {Brackets}

Then fill formula to L6


Excel Workbook
ABCDEFGHIJKLMN
11DateAmountNumberDate_Unique123
221/1/201025011/1/2010250250
331/2/201030011/2/2010300300
441/3/201035011/3/2010350350
551/4/201040011/4/2010400400
661/1/201025021/5/2010#N/A450
771/2/20103002
881/3/20103502
991/4/20104002
10101/5/20104502
Sheet1
 
Upvote 0

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
This works perfectly! :beerchug: Thanks!!

(1) Can this be auto-generated every time I open the excel file?

What we do is, export the data(the daily counts logged into our office application) into an excel file for reporting purpose. Once we have the excel file, I would like the code to run automatically for all the new data as well.


(2 a) Can you please tell me what doesthe pipe, "|" do?
(2 b) How does $D$2 differ from $D2 ?
 
Upvote 0
1) Likely yes, I'd suggest making a new thread for that..

2a) The pipe is a bit of overkill, probably not required in this case.
But my motto is "Better to have and not need, then to need and not have"

Basically, we are concatenating 2 cells together, say K1 and J2
Now, consider
K1 = 1234
J2 = 5678

And you're looking for exactly that, 12345678
Now, if
K1 = 123
J2 = 45678

It would still find the match K1&J2 = 12345678
So putting the pipe in the middle fixes that because now
K1&"|"&J2 = 123|45678
But you're trying to find 1234|5678


2b) The $ in a reference locks that reference. So that it does not incriment when filling formula left/right/up/down.
D2 changes to D2 when filled down
D2 changes to E2 when filled right
$D2 STAYS as $D2 when filled Right
D$2 STAYS as D$2 when filled down
$D$2 does not change no matter which way you fill left/right/up/down


Hope that helps.
 
Upvote 0
Thanks! That was very helpful.


Actually just one more question which I forgot to ask earlier: - What does Ctrl+Shift+Enter do to make the formula work?


I will start a new thread because I have to see this project through completion:)


Thank you once again. I really appreciate your timely help.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,903
Members
452,948
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top