+ Reply to Thread
Results 1 to 17 of 17

if statement to perform a calculation of a cell has a number else do nothing ... so if tex

  1. #1
    Registered User
    Join Date
    10-19-2007
    Location
    North Carolina USA
    MS-Off Ver
    Excel MSO 2019 64-bit
    Posts
    14

    if statement to perform a calculation of a cell has a number else do nothing ... so if tex

    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

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,769

    Re: if statement to perform a calculation of a cell has a number else do nothing ... so if

    =IF(OR(ISTEXT(A1),A1=""),"",calculation formula)

  3. #3
    Registered User
    Join Date
    10-19-2007
    Location
    North Carolina USA
    MS-Off Ver
    Excel MSO 2019 64-bit
    Posts
    14

    Re: if statement to perform a calculation of a cell has a number else do nothing ... so if

    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.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,769

    Re: if statement to perform a calculation of a cell has a number else do nothing ... so if

    ... 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.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,769

    Re: if statement to perform a calculation of a cell has a number else do nothing ... so if

    ..or

    =IF(ISNUMBER(A1),C1*10,"")

  6. #6
    Registered User
    Join Date
    10-19-2007
    Location
    North Carolina USA
    MS-Off Ver
    Excel MSO 2019 64-bit
    Posts
    14

    Re: if statement to perform a calculation of a cell has a number else do nothing ... so if

    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

  7. #7
    Registered User
    Join Date
    10-19-2007
    Location
    North Carolina USA
    MS-Off Ver
    Excel MSO 2019 64-bit
    Posts
    14

    Re: if statement to perform a calculation of a cell has a number else do nothing ... so if

    so how do you tell excel to do nothing, but not to wipe out the text content of a cell

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,769

    Re: if statement to perform a calculation of a cell has a number else do nothing ... so if

    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.

  9. #9
    Registered User
    Join Date
    10-19-2007
    Location
    North Carolina USA
    MS-Off Ver
    Excel MSO 2019 64-bit
    Posts
    14

    Re: if statement to perform a calculation of a cell has a number else do nothing ... so if

    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.
    Attached Files Attached Files

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,188

    Re: if statement to perform a calculation of a cell has a number else do nothing ... so if

    This works for me in your sample file:
    Formula: copy to clipboard
    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


  11. #11
    Registered User
    Join Date
    10-19-2007
    Location
    North Carolina USA
    MS-Off Ver
    Excel MSO 2019 64-bit
    Posts
    14

    Re: if statement to perform a calculation of a cell has a number else do nothing ... so if

    Is there a way to not overwrite text that might already exist in a cell?
    Attached Files Attached Files

  12. #12
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,646

    Re: if statement to perform a calculation of a cell has a number else do nothing ... so if

    Try:
    =IFERROR(C5*1.75,C5)
    Quang PT

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,188

    Re: if statement to perform a calculation of a cell has a number else do nothing ... so if

    Is there a way to not overwrite text that might already exist in a cell?
    No. As has already been said, a cell has a value (which may include blank) or a formula. It cannot have both.

  14. #14
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,646

    Re: if statement to perform a calculation of a cell has a number else do nothing ... so if

    Quote Originally Posted by mwburne View Post
    Is there a way to not overwrite text that might already exist in a cell?
    If range is mixed with text and value, then you want to multiply with,i.e,1.75:

    1) type 1.75 in any blank cell. Ctrl-C (copy this cell)

    2) Choose the range

    3) Paste special: Operation: Multiply

    4) OK

    Now all values have been muliplied with 1.75, while text cells not.

  15. #15
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,769

    Re: if statement to perform a calculation of a cell has a number else do nothing ... so if

    do you mean

    =IF(ISNUMBER(C5), C5*1.75,C5)

    as already offered as a solution (#12)

  16. #16
    Registered User
    Join Date
    10-19-2007
    Location
    North Carolina USA
    MS-Off Ver
    Excel MSO 2019 64-bit
    Posts
    14

    Re: if statement to perform a calculation of a cell has a number else do nothing ... so if

    This is perfect! This worked! Thank you so much. I had a difficult time explaining what I was trying to achieve,... this worked!!
    Mike

  17. #17
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,188

    Re: if statement to perform a calculation of a cell has a number else do nothing ... so if

    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 01-28-2021, 09:11 AM
  2. [SOLVED] Formula to perform calculation with n number of rows based on cell value
    By ironfelix717 in forum Excel General
    Replies: 12
    Last Post: 11-21-2017, 04:58 PM
  3. [SOLVED] IF FUNCTION Help - IF Cell= X Then Perform This Calculation, Otherwise Return Value of 0
    By JONBOY666 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-30-2015, 07:21 AM
  4. Perform a calculation depending on a cell value
    By Bonfirehead in forum Excel General
    Replies: 1
    Last Post: 12-14-2012, 10:38 AM
  5. Can a cell contain text and perform calculation?
    By drewship in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-18-2009, 02:43 PM
  6. perform a calculation on the number part of the string
    By bilbonvidia in forum Excel General
    Replies: 2
    Last Post: 07-13-2007, 04:47 PM
  7. Perform a calculation only once on a cell
    By ndavies in forum Excel General
    Replies: 0
    Last Post: 01-24-2005, 06:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1