#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default if statement

Hi there

I have a file to calculated costs that depend on time in a location.
The cells look something like this:

A1 A2 A3 A4
A5
1 less than 12 hours 10222 .027
=A3*A4
2 12<24 hours 10222 .012
=B3*B4
3 24<48 hours 10222 .005
=C3*C4
4 48 hours 10222 .005
=D3*D4

I have a cell where the user will select the corresponding number (1,2,3 or 4)
I want a cell that will calculated the total according to the number that
the user puts into the cell.
If the totals are culmative, ei, if "1" then = A5
if "2" then = A5+B5
if "3" then = A5+B5+C5
if "4" then = A5+B5+C5+D5

How do a do this?

--
Thank-you!
Ruth
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default if statement

One ro
Somewhere on your sheet put these in (Say E1:F4) numbers in Col E and
Formulas in Col F
1 =A5
2 =A5+B5
3 =A5+B5+C5
4 =A5+B5+C5+D5

Then assuming you have 1 or 2 or 3 or 4 in A7, enter this in B7
=VLOOKUP(A7,$E$1:$F$4,2,FALSE)
and copy down...
"Ruth" wrote:

Hi there

I have a file to calculated costs that depend on time in a location.
The cells look something like this:

A1 A2 A3 A4
A5
1 less than 12 hours 10222 .027
=A3*A4
2 12<24 hours 10222 .012
=B3*B4
3 24<48 hours 10222 .005
=C3*C4
4 48 hours 10222 .005
=D3*D4

I have a cell where the user will select the corresponding number (1,2,3 or 4)
I want a cell that will calculated the total according to the number that
the user puts into the cell.
If the totals are culmative, ei, if "1" then = A5
if "2" then = A5+B5
if "3" then = A5+B5+C5
if "4" then = A5+B5+C5+D5

How do a do this?

--
Thank-you!
Ruth

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default if statement

Thank-you very much!
--

Ruth


"Sheeloo" wrote:

One ro
Somewhere on your sheet put these in (Say E1:F4) numbers in Col E and
Formulas in Col F
1 =A5
2 =A5+B5
3 =A5+B5+C5
4 =A5+B5+C5+D5

Then assuming you have 1 or 2 or 3 or 4 in A7, enter this in B7
=VLOOKUP(A7,$E$1:$F$4,2,FALSE)
and copy down...
"Ruth" wrote:

Hi there

I have a file to calculated costs that depend on time in a location.
The cells look something like this:

A1 A2 A3 A4
A5
1 less than 12 hours 10222 .027
=A3*A4
2 12<24 hours 10222 .012
=B3*B4
3 24<48 hours 10222 .005
=C3*C4
4 48 hours 10222 .005
=D3*D4

I have a cell where the user will select the corresponding number (1,2,3 or 4)
I want a cell that will calculated the total according to the number that
the user puts into the cell.
If the totals are culmative, ei, if "1" then = A5
if "2" then = A5+B5
if "3" then = A5+B5+C5
if "4" then = A5+B5+C5+D5

How do a do this?

--
Thank-you!
Ruth

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sum if statement with a left statement Eric D Excel Discussion (Misc queries) 4 July 23rd 08 05:31 PM
SUMIF statement with AND statement Eric D Excel Discussion (Misc queries) 2 July 14th 08 07:24 PM
Can an If statement answer an If statement? M.A.Tyler Excel Discussion (Misc queries) 2 June 24th 07 04:14 AM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM
If statement and Isblank statement Rodney C. Excel Worksheet Functions 0 January 18th 05 08:39 PM


All times are GMT +1. The time now is 05:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"