#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
dcjones
 
Posts: n/a
Default IF Statement


Hi All,

I am not to good with excel but I am learning fast.

Problem, I have a worksheet, on the sheet there are 3 col's.

Col1 could contain the word "home"
Col2 contains mileage.

What I want to do is:-

If COL1 contains the word "home" then COL2 contains the amount of miles
LESS 8 miles.

Can anyone point me in the right direction to create a formula,

Many thanks in advance.

Happy new year to you all at 24:00 01/01/05-06

Regards

Dereck


--
dcjones
------------------------------------------------------------------------
dcjones's Profile: http://www.excelforum.com/member.php...o&userid=29941
View this thread: http://www.excelforum.com/showthread...hreadid=496415

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default IF Statement

Something like:

=if(a1="home",b1-8,"what goes here instead")

And drag down your column.

dcjones wrote:

Hi All,

I am not to good with excel but I am learning fast.

Problem, I have a worksheet, on the sheet there are 3 col's.

Col1 could contain the word "home"
Col2 contains mileage.

What I want to do is:-

If COL1 contains the word "home" then COL2 contains the amount of miles
LESS 8 miles.

Can anyone point me in the right direction to create a formula,

Many thanks in advance.

Happy new year to you all at 24:00 01/01/05-06

Regards

Dereck

--
dcjones
------------------------------------------------------------------------
dcjones's Profile: http://www.excelforum.com/member.php...o&userid=29941
View this thread: http://www.excelforum.com/showthread...hreadid=496415


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
wjohnson
 
Posts: n/a
Default IF Statement


Example A6=Home
B6=40
C6=32
=IF(A6="home",B6-8,"Check")
The "Check" is whatever you want to have for the "FALSE" part of the
statement. You can also add another "IF" condition: The following
statement
is the same as the above for the 1st IF - the 2nd IF is adding 8 if
A6=Work.
=IF(A6="home",B6-8,IF(A6="work",B6+8,"Check")).
You can have upto 7 "IF" Statements in on formula.


--
wjohnson
------------------------------------------------------------------------
wjohnson's Profile: http://www.excelforum.com/member.php...o&userid=29640
View this thread: http://www.excelforum.com/showthread...hreadid=496415

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
dcjones
 
Posts: n/a
Default IF Statement


Hi both and thanks for your replies.

Just to run this by you again so I fully understand it (thick day)

Cell L5 contains "home"
Cell S5 contains "10" (for testing)
Cell AE5 has the following formula behind it:-

=IF(L5="home",S5-8,"Check") This is where I do not understand it
(sorry)

=IF(L5="home" and S5= "any number" then AE5 should = S5 - 8)

Does that make sense, I know its not written as a formula (again
sorry)

Any help would be great.

Many thanks, keep safe and well.

Dereck


--
dcjones
------------------------------------------------------------------------
dcjones's Profile: http://www.excelforum.com/member.php...o&userid=29941
View this thread: http://www.excelforum.com/showthread...hreadid=496415

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
darkwood
 
Posts: n/a
Default IF Statement


What he means by "check" is that as you are writing an "IF" statement,
you have to say what you want the value to be if true, and what if is
it false. So if you say L5 = home and S5 = 10 then you are correct
with the formula as it is written. However, if L5 contains something
besides "home", you have to indicate in the formula what you want
returned as well. If you don't want anything, and want it to be blank,
just enter two sets of quotes.

so:

=IF(L5="home",S5-8,"") for a blank returned.

However, since you have 'home' listed, I assume you have another
location as well that you don't want to apply the (-8) to, and just
want it to equal the mileage field without any subtraction you'd use
this:

=IF(L5="HOME",S5-8,S5)

HTH

-Scott


--
darkwood
------------------------------------------------------------------------
darkwood's Profile: http://www.excelforum.com/member.php...o&userid=29948
View this thread: http://www.excelforum.com/showthread...hreadid=496415

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
IF Statement problem trixma New Users to Excel 3 September 27th 05 06:36 AM
If statement Matt Montagliano Excel Discussion (Misc queries) 1 September 8th 05 08:47 PM
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM
IF Statement Brent New Users to Excel 3 April 29th 05 04:24 PM
7+ nested if statement? Turi Excel Worksheet Functions 3 December 20th 04 07:55 PM


All times are GMT +1. The time now is 06:07 PM.

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"