I tried search for this but the search tool excludes words like When....

Here is the situation. I have a drop down cell (A1 below) in which you can choose a month, and another cell (B1 below) which the shows the total cost for a given month.

        A                      B
1    Sep-09     *sums costs for month chosen in A1*

I would like to produce a table as below, giving values in column D1 when cell A1 contains the different values in column C.

       C                       D
1    Sep-09     *to equal cell B1 when A1 = C1*
2    Oct-09     *to equal cell B1 when A1 = C2*
2    Nov-09     *to equal cell B1 when A1 = C3*
Is there a formula which I could enter in column D which would produce the values described, or would I have to manually change cell A1 and input the B1 outputs into column D?

I'm thinking it may be a sort of "equals B1 when A1 = C1" type of formula...

Thanks