Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How do I test a condition in one cell and write to another.

I would like to test a condition in a cell and then write something in
another cell.

For Example my If statement is in cell d23 and this is what I want to do: If
c23=#VALUE! then b23=0.

Is this possible.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 964
Default How do I test a condition in one cell and write to another.

No, not possible. A formula in one cell cannot place it's results in a
different cell.

Why not just place the formula in cell B23? Or, if B23 already contains a
formula, just incorporate this into it. Something like:

=IF(ISERROR(C23),0,YourFormula)

HTH
Elkar

"dorf" wrote:

I would like to test a condition in a cell and then write something in
another cell.

For Example my If statement is in cell d23 and this is what I want to do: If
c23=#VALUE! then b23=0.

Is this possible.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default How do I test a condition in one cell and write to another.

You cannot write to another cell using a formula.

You have to have the formula in B23

=IF(ISERROR(C23,0,"whatever")

The only way to write to a cell without a formula is through VBA

Do you want to go that route via sheet event code?

Private Sub Worksheet_Calculate()
On Error GoTo stoppit
Application.EnableEvents = False
With Me.Range("C23")
If IsError(.Value) Then
Me.Range("B23").Value = 0
Else: Me.Range("B23").Value = "whatever"
End If
End With
stoppit:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Mon, 18 May 2009 15:40:01 -0700, dorf
wrote:

I would like to test a condition in a cell and then write something in
another cell.

For Example my If statement is in cell d23 and this is what I want to do: If
c23=#VALUE! then b23=0.

Is this possible.


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 do I write an If(And( function using dates as my logical test? mclovin Excel Worksheet Functions 4 March 25th 09 05:12 PM
logical test for an #N/A condition in a cell F.Rosario Excel Discussion (Misc queries) 6 December 19th 07 10:43 PM
Need to test for alphanumeric value and write numeric values to ce Pyramid 36 Excel Worksheet Functions 3 August 3rd 07 03:15 AM
Need to test for a specific text string and write value to another Pyramid 36 Excel Worksheet Functions 2 August 3rd 07 12:55 AM
Cell text based on 4 condition test Bob Wall Excel Worksheet Functions 3 November 16th 05 07:34 PM


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