Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calculation based on lists selected

Hi,

I have validated a cell(Data Validation) where the validation criteria
allows a list and the source is 2 cells containing Y, N.
Now, depending on the list selected, a formula should be calculated.
ie. if Y, (B1+B2)-(A1+A2)
if N, (C1+C2)-(A1+A2)

I have tried a lot but in vain.

Pls help out.
Sups


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Calculation based on lists selected

Hi
assuming that your validated cell is A3 and the target cell A4 enter
the following in A4:
=IF(A3="Y",B1+B2-(A1+A2),IF(A3="N",C1+C2-(A1+A2),""))

HTH
Frank

Hi,

I have validated a cell(Data Validation) where the validation

criteria
allows a list and the source is 2 cells containing Y, N.
Now, depending on the list selected, a formula should be calculated.
ie. if Y, (B1+B2)-(A1+A2)
if N, (C1+C2)-(A1+A2)

I have tried a lot but in vain.

Pls help out.
Sups


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Calculation based on lists selected

Supriya,

Do you just want a formula?

If so, assuming DV is in A1, it is

=IF(A1="Y",(B1+B2)-(A1+A2),(C1+C2)-(A1+A2))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Supriya " wrote in message
...
Hi,

I have validated a cell(Data Validation) where the validation criteria
allows a list and the source is 2 cells containing Y, N.
Now, depending on the list selected, a formula should be calculated.
ie. if Y, (B1+B2)-(A1+A2)
if N, (C1+C2)-(A1+A2)

I have tried a lot but in vain.

Pls help out.
Sups


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calculation based on lists selected

Hi Frank,

It worked perfectly fine.
Thanks a lot

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Calculation based on lists selected

Frank,

If using DV, then it can only be Y or N, so the extra N test is superfluous.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Frank Kabel" wrote in message
...
Hi
assuming that your validated cell is A3 and the target cell A4 enter
the following in A4:
=IF(A3="Y",B1+B2-(A1+A2),IF(A3="N",C1+C2-(A1+A2),""))

HTH
Frank

Hi,

I have validated a cell(Data Validation) where the validation

criteria
allows a list and the source is 2 cells containing Y, N.
Now, depending on the list selected, a formula should be calculated.
ie. if Y, (B1+B2)-(A1+A2)
if N, (C1+C2)-(A1+A2)

I have tried a lot but in vain.

Pls help out.
Sups






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Calculation based on lists selected

Hi
thanks for the thanks
Frank
Hi Frank,

It worked perfectly fine.
Thanks a lot.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Calculation based on lists selected

Bob,
definetly right. Was overcautious :-)
Frank

Bob Phillips wrote:
Frank,

If using DV, then it can only be Y or N, so the extra N test is
superfluous.


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calculation based on lists selected

Bob,

You are right!
If there are only only 2 conditions, there is no need to specify th
2nd one.

It simplified my formula

--
Message posted from http://www.ExcelForum.com

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 keep the drop down arrow on data lists when not selected? Diamondgirl Excel Worksheet Functions 3 August 8th 09 01:52 AM
Highlight the cell based on selected value Max Excel Worksheet Functions 2 July 1st 09 09:57 AM
Returning value in secocolumn based on selected value in first col Kicker Excel Worksheet Functions 1 March 27th 09 06:01 PM
Perform a calculation based on a cell being selected fluffy Excel Worksheet Functions 2 December 24th 08 05:38 PM
How to clear validation lists based on other validation lists Ben Excel Discussion (Misc queries) 1 March 12th 07 07:11 PM


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