ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Help using the 'If' function to automatically fill in other cells (https://www.excelbanter.com/excel-worksheet-functions/41505-help-using-if-function-automatically-fill-other-cells.html)

Bugaglugs

Help using the 'If' function to automatically fill in other cells
 
I'm trying to write a formula which will generate a value in one cell
dependent on what the user chooses in the other. See below for example (the
worksheet is to record the charges incurred when certain rooms within a
complex are booked).
So for example if the 'blue room' is booked, the the corresponding cell in
row 2 should be prefilled with '£2500'
(Row 1) (Row 2)
Room Booked Cost of Booking
(Choices - I've used data validation)
Blue Room
Red Room
Blue Room & Red Room
Green Lounge
Whole Complex

Ron Rosenfeld

On Sun, 21 Aug 2005 12:28:01 -0700, Bugaglugs
wrote:

I'm trying to write a formula which will generate a value in one cell
dependent on what the user chooses in the other. See below for example (the
worksheet is to record the charges incurred when certain rooms within a
complex are booked).
So for example if the 'blue room' is booked, the the corresponding cell in
row 2 should be prefilled with '£2500'
(Row 1) (Row 2)
Room Booked Cost of Booking
(Choices - I've used data validation)
Blue Room
Red Room
Blue Room & Red Room
Green Lounge
Whole Complex


Look at HELP for VLOOKUP.

Set up a table, perhaps including the validation choice list.

E.g. if your list is in AA1:AA5, enter the respective costs in BB1:BB5.

Then in Row2 enter a formula of the type:

=IF(Row1_cell_ref="","",VLOOKUP(Row1_cell_ref, AA1:BB5,2,FALSE)


--ron

Gord Dibben

I would use the VLOOKUP function in the to-be-filled-in-cells.

Basically you need two columns. One with the DV list and one with the Cost of
Booking.

See Debra Dalgleish's site for info.

http://www.contextures.on.ca/xlFunctions02.html


Gord Dibben Excel MVP



On Sun, 21 Aug 2005 12:28:01 -0700, Bugaglugs
wrote:

I'm trying to write a formula which will generate a value in one cell
dependent on what the user chooses in the other. See below for example (the
worksheet is to record the charges incurred when certain rooms within a
complex are booked).
So for example if the 'blue room' is booked, the the corresponding cell in
row 2 should be prefilled with '£2500'
(Row 1) (Row 2)
Room Booked Cost of Booking
(Choices - I've used data validation)
Blue Room
Red Room
Blue Room & Red Room
Green Lounge
Whole Complex



Bugaglugs

Thanks very much for your prompt response - I hadn't heard of the VLOOKUP
function before (am very much learning by trial and error as I go along).
I'll have a look at the suggested website.

"Gord Dibben" wrote:

I would use the VLOOKUP function in the to-be-filled-in-cells.

Basically you need two columns. One with the DV list and one with the Cost of
Booking.

See Debra Dalgleish's site for info.

http://www.contextures.on.ca/xlFunctions02.html


Gord Dibben Excel MVP



On Sun, 21 Aug 2005 12:28:01 -0700, Bugaglugs
wrote:

I'm trying to write a formula which will generate a value in one cell
dependent on what the user chooses in the other. See below for example (the
worksheet is to record the charges incurred when certain rooms within a
complex are booked).
So for example if the 'blue room' is booked, the the corresponding cell in
row 2 should be prefilled with '£2500'
(Row 1) (Row 2)
Room Booked Cost of Booking
(Choices - I've used data validation)
Blue Room
Red Room
Blue Room & Red Room
Green Lounge
Whole Complex





All times are GMT +1. The time now is 11:55 PM.

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