How to create an if statement to perform a calculation of a cell has a number else do nothing ... so if text do nothing and if cell black do nothing
How to create an if statement to perform a calculation of a cell has a number else do nothing ... so if text do nothing and if cell black do nothing
=IF(OR(ISTEXT(A1),A1=""),"",calculation formula)
Thank you for responding. I tried it and it says I'm missing a opening or closing parenthesis and I stated the question, incorrectly, my apologies. I want to check a cell and only perform the calculation if the cell is a number and not blank and not text.
... which is what the formula does. You obviously did not try it.
As an example, put number in C1 and A1, and formula below in B1
=IF(OR(ISTEXT(A1),A1=""),"",C1*10)
Delete number from A1
Last edited by JohnTopley; 04-03-2021 at 04:03 PM.
..or
=IF(ISNUMBER(A1),C1*10,"")
I did try it and it doesn't work the way I need it to,... it does perform the calculation if it's there's a number but if there is a blank cell or text it makes the cell blank
so how do you tell excel to do nothing, but not to wipe out the text content of a cell
Post a file ..
See yellow banner at top of thread.
You cannot have a formula and text in the same cell if that is what you mean from your last post.
Last edited by JohnTopley; 04-03-2021 at 04:58 PM.
Here is the file, if there is text or a blank cell I want to do nothing,,,
If there is a number I want to multiple by 1.75, I don't want text or
blank cells to be changed.
This works for me in your sample file:Formula:![]()
Please Login or Register to view this content.
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Is there a way to not overwrite text that might already exist in a cell?
Try:
=IFERROR(C5*1.75,C5)
Quang PT
No. As has already been said, a cell has a value (which may include blank) or a formula. It cannot have both.Is there a way to not overwrite text that might already exist in a cell?
do you mean
=IF(ISNUMBER(C5), C5*1.75,C5)
as already offered as a solution (#12)
This is perfect! This worked! Thank you so much. I had a difficult time explaining what I was trying to achieve,... this worked!!
Mike
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
New quick method:
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
Or you can use this way:
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks