# Return a formula

#### babyg

##### New Member
I have a worksheet that contains 4 columns. Column A is a \$ amount, Column B is the frequency (ie hourly, weekly, monthly, annually), Column C is the written out version of the formula used to calculate the total, and Column D is the total amount. I am looking for a way to populate Column C based on the data entered. So if the frequency was monthly it would show the vaule of column A times 12, or if annually it would show the value of column A times 1.

Example:

A B C D
\$800 Monthly 800 x 12 \$9600

### Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

#### T. Valko

##### Well-known Member
I have a worksheet that contains 4 columns. Column A is a \$ amount, Column B is the frequency (ie hourly, weekly, monthly, annually), Column C is the written out version of the formula used to calculate the total, and Column D is the total amount. I am looking for a way to populate Column C based on the data entered. So if the frequency was monthly it would show the vaule of column A times 12, or if annually it would show the value of column A times 1.

Example:

A B C D
\$800 Monthly 800 x 12 \$9600
If Monthly is x 12 then what are the other multipliers?

#### babyg

##### New Member
Annually is value of column A x 1
Hourly is value of column A x 40 x 52
Weekly is value of column A x 52

#### T. Valko

##### Well-known Member
Annually is value of column A x 1
Hourly is value of column A x 40 x 52
Weekly is value of column A x 52
Try this...

Book1
ABCD
2800Monthly800 x 129600
310Hourly10 x 40 x 5220800
417Weekly17 x 52884
525Annually25 x 1300
6____
7____
8____
9____
10Annually1__
11Hourly2080__
12Monthly12__
13Weekly52__
Sheet1

This formula entered in D2 and copied down:

=A2*IF(B2="annually",12,IF(B2="hourly",2080,IF(B2="weekly",52,IF(B2="monthly",12))))

Or, you could create a 2 column table as shown and use this formula:

=A2*IF(COUNTIF(A\$10:A\$13,B2),VLOOKUP(B2,A\$10:B\$13,2,0))

#### babyg

##### New Member
Is there also a formula that can be used to fill in the contents of column C as shown?

#### T. Valko

##### Well-known Member
Is there also a formula that can be used to fill in the contents of column C as shown?
If you use the lookup table...

Book1
ABCD
2800Monthly800 x 129600
310Hourly10 x 208020800
417Weekly17 x 52884
525Annually25 x 1300
6____
7____
8____
9____
10Annually1__
11Hourly2080__
12Monthly12__
13Weekly52__
Sheet1

This formula entered in C2 and copied down:

=A2&" x "&VLOOKUP(B2,A\$10:B\$13,2,0)

#### babyg

##### New Member
Great. Thanks so much for your help

Replies
3
Views
135
Replies
3
Views
609
Replies
2
Views
194
Replies
3
Views
124
Replies
5
Views
250

1,195,590
Messages
6,010,612
Members
441,558
Latest member
lambierules

### 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.

### Which adblocker are you using?

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

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