Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
jbsand1001
 
Posts: n/a
Default Compare 2 cells values with one IF statement

I am trying to find out if it is possible to comapre 2 cells with one of the
cells I having 2 different values to compare. For example

I am need for it to look in J2 and say if J2= 20 it will add 136 but if J2 =
40 it will add 165.


below is what I have so far but I am trying to find out if it can look at a
second argument in j2?
=IF(B2="something",J2+136,M2+0)


Any guidance would be greatly appreciated.

Judd


  #2   Report Post  
Gary's Student
 
Posts: n/a
Default

In your formula, try replacing
J2+136
With
(J2=20)*136+(J2=40)*165

This should return the correct value and return zero if J2 does not equal
either 20 or 40.

--
Gary's Student


"jbsand1001" wrote:

I am trying to find out if it is possible to comapre 2 cells with one of the
cells I having 2 different values to compare. For example

I am need for it to look in J2 and say if J2= 20 it will add 136 but if J2 =
40 it will add 165.


below is what I have so far but I am trying to find out if it can look at a
second argument in j2?
=IF(B2="something",J2+136,M2+0)


Any guidance would be greatly appreciated.

Judd


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
How to use SUMIF to return sums between two values located in cells ScottBerger Excel Worksheet Functions 2 April 23rd 23 09:05 PM
How do I compare data in two worksheets to find matching cells? Gary Excel Discussion (Misc queries) 4 March 2nd 06 09:04 PM
Can you extract URL values from a list of cells? BigIan Excel Worksheet Functions 7 December 23rd 05 05:20 AM
If formula that looks at multiple cells and values, and then calul Adam Excel Discussion (Misc queries) 1 June 5th 05 11:31 AM
How To Use Cells Without Values in a Formula Roger H. Excel Worksheet Functions 2 April 6th 05 01:01 AM


All times are GMT +1. The time now is 02:01 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"