MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 30th, 2004, 04:36 PM   #1
Anthony G.
 
Join Date: Mar 2002
Posts: 465
Default If, Then Statement....?

Hello To All:

The user will enter data into cells that fall within columns A:C, which will then put the formulas in column D to work. Cells in column E will use Data Validation in order to allow the user to select from a list of disciplines. Currently, cells A10:B13 house the disciplines and their cost, which allows the formulas in column F to work only if done manually. The goal is to place a formula into the cells in column F that would automatically perform the calculation once the user selects the desired Discipline from the drop-down menu...is that possible?

Thanks...Anthony

******** ******************** ************************************************************************>
Microsoft Excel - Book2___Running: xl2002 XP : OS = Windows Windows 2000
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)bout
=

A
B
C
D
E
F
1
DistrictTotal*EnrollGradesAdopt*EnrollDisciplineCost
2
Cuba*City*School*District276279*Reading$7,886*
3
Milwaukee*-*Private85785*Language*Arts$6,375*
4
Erin*School*District2664152*Science$7,600*
5
Racine2626225*Reading*
6
Waukesha*-*Private2207220*Health*
7
Grant79668*Science*
8
******
9
******
10
Reading$100****
11
Language*Arts$75****
12
Science$50****
13
Health$25****
Sheet1*

[HtmlMaker 2.32] To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.
Anthony G. is offline   Reply With Quote
Old Mar 30th, 2004, 04:42 PM   #2
onlyadrafter
 
Join Date: Aug 2003
Location: England
Posts: 4,584
Default Re: If, Then Statement....?

Hello

Try in F2,

=D2*VLOOKUP(E2,$A$10:$B$13,2,0)

Does this work? (I haven't tested it).

This is not necessary.

Sorry, forgot to mention to sort A10:B13 in ascending order by Col A.
__________________
-------------------------
Hope this is helpful.
-------------------------
only a drafter,
but broadening my Excel knowledge.
onlyadrafter is offline   Reply With Quote
Old Mar 30th, 2004, 04:55 PM   #3
onlyadrafter
 
Join Date: Aug 2003
Location: England
Posts: 4,584
Default Re: If, Then Statement....?

Hello

Brian,

I wrote this, incorrectly obviously, because I only found out about the ,0 at the end of the VLOOKUP.

But thank you for correcting me, much appreciated, something else I have learnt.

WHERE HAS YOUR POST GONE?
__________________
-------------------------
Hope this is helpful.
-------------------------
only a drafter,
but broadening my Excel knowledge.
onlyadrafter is offline   Reply With Quote
Old Mar 30th, 2004, 04:59 PM   #4
DRJ
MrExcel MVP
 
DRJ's Avatar
 
Join Date: Feb 2002
Location: California
Posts: 3,857
Default

=SUMPRODUCT(($A$10:$A$13=E2)*($B$10:$B$13)*(D2))
__________________
Excel VBA Training and Certification (Lesson 1 is free)
<hr>

<hr>-Jacob
DRJ is offline   Reply With Quote
Old Mar 30th, 2004, 05:32 PM   #5
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 39,503
Default Re: If, Then Statement....?

Sort A10:B13 on its first column, which would enable to use a fast lookup formula in F2...

=D2*LOOKUP(E2,$A$10:$B$13)

or, A10:B13 as is, a SumIf formula in F2...

=D2*SUMIF($A$10:$A$13,E2,$B$10:$B$13)

which is also fast.
Aladin Akyurek is offline   Reply With Quote
Old Mar 30th, 2004, 07:42 PM   #6
Anthony G.
 
Join Date: Mar 2002
Posts: 465
Default Re: If, Then Statement....?

...And fast it was - Thank You...Thank you All!

Anthony
Anthony G. is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


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


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 by MrExcel Consulting.