if statement

  1. A

    IF AND/OR Help!

    Hi all, I've nested an if and/or formula and all seems to be working well except for one odd result. I was wondering if someone could help. Attached is a screenshot. The formula reads as follows for row 3...
  2. D

    Error using IF/AND/OR Statement with multiple conditions

    I am trying to write a formula based on the following conditions and it is not working IF A1 = "S", and B1 = 254 or 127, Use LIST NOLIST IF A1 = "F" or "M", and B1 = 254, and C1 is even, Use LIST EVEN254 IF A1 = "F" or "M", and B1 = 254, and C1 is odd, use LIST ODD254 IF A1 = "F" or "M", and...
  3. A

    Loop column E if cell non-blank, then insert formula on other column

    Hi, I have these VBA code that I run through each range to divide and insert if formula. Initial it has no issue, but now I have new lines, which I do not need to insert the formula if column E (Qty) is empty. And I do not know how to apply the command, if column E is non blank, then apply the...
  4. D

    How to incorporate into F1C1 Formula with IF Statement RC[n] value?

    Hello everyone. Given: Range("P2").FormulaR1C1 = "=IF ( AND ( RC [-7 ] > RC [-6], R [1] C [-7] < R [1] C [-6]) ,""Text message"", """") ) I've been trying to insert value (Number) of the cell RC[-6] (from the same Row) instead of "Text message" but I could not succeed and I don't even know...
  5. A

    Use Before Save Event to Prevent Saving If No Checkboxes Are Selected

    Hello! I am attempting to use the BeforeSave event to check whether any of the checkboxes are selected before allowing the user to save the workbook. Please see my code below. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) MsgBox "Entered Sub...
  6. C

    strange result - Nested IF statement

    A B C D E F G H Reporting Date Invoice ID invoice payment id invoice header id invoice terms date vendor number po/non-po flag supplier name 23-Apr-20 1900057573_5430_2020_0001064077 1900057573_5430_2020 0001064077 NON_PO GT TRANSPORT 2012 CO LTD 23-Apr-20...
  7. D

    Data consolidation with permanent cell and IF statement

    Hello, im having trouble with coming up with a formula for the following case: We have sheet with data about different products: Product Quantity Location Product 1 5 1-1-1 Product 1 10 1-1-1 Product 1 5 1-1-2 Product 2 10 1-1-2 Product 3 5 1-1-2 Product 3 10 1-1-3 Our...
  8. J

    Macro terminated after the first condition in IF is met

    Hello guys, I have this code of mine in the Macro (And yea, I tried using the classis "i" as a variable, did not work so I changed it to "g") For g = 1 To 20 If (InStr(1, salesWS.Cells(g, 2).Value, "X004a", 1) > 0 And InStr(1, salesWS.Cells(g, 3).Value, "TOBI", 1) > 0 And...
  9. K

    VBA Code that gives results in MsgBox

    Ideally I would like the message box to display whether any discrepancies were identified in sheet 3. The data in sheet 1&2 should be identical, so when the macro is run the results in sheet 3 should show no data because there is no discrepancy. Now, if there are discrepancies between the data...
  10. K

    VBA code that returns the results of macro in a MsgBox

    At the end of running my macro I would really like it if a message box appeared displaying the results of the macro. The message box would say "X" number discrepancies were identified, or "0" discrepancies were identified. I am having great difficulty making this happen, i would really...
  11. H

    Multiple Matches

    Hi, After previously having a huge amount of help via this forum previously I’m hoping one of you excel gods wouldn’t mind looking at another thing that’s got me stumped. So I’m trying to identify where a telephone call has been made by an agent during a time period they weren’t supposed to be...
  12. tlc53

    Join to IF Statements referring to percentages

    Hi there, I can't work out why I can't join these two IF Statements. Separately, they work fine. =IF(J40<3.5%,"Acceptable Variance (Does not exceed 3%)","Unacceptable Variance! (Exceeds 3%)") =IF(J40>-3.5%,"Acceptable Variance (Does not exceed 3%)","Unacceptable Variance! (Exceeds 3%)") But...
  13. tlc53

    IF Statement to return number as Text

    Hi there, Cell H15 is formatted to text and has the following formula in it; =IF(F15<>0,426,"") I have other formulas (INDEX/MATCH/VLOOKUP) which refer to cell H15. If I just type 426 into H15 everything works fine, but if it returns 426 through the IF statement above, it returns errors on my...
  14. D

    Inserting a Visible Autofiltered Row into Another Sheet (Excluding Header)

    I am trying to AutoFilter (in column A of SHEET 1) the Active Cell in SHEET 2. Then I have an IF Statement that counts the number of Visible Rows, and if it is more than 1 (to exclude the header) then I would like to insert a new row into SHEET 3 and cut and paste the values of the Auto filtered...
  15. S

    Textbox value change to Red if greater than 0

    Hi, I was sure that the following code below changes to Red if my Cell from E34 ( 1 ) and Cell (Q34) is ( 0 ) then please change my Textbox to "RED". Can someone check please - cause it aint working. Private Sub Textbox32_Change() If Sheet5.Range("E34").Value > Sheet5.Range("Q34").Value Then...
  16. tlc53

    Return Text if Number Matches

    Hi, I have been trying to figure out this formula for sometime and feel it's now time to call in the experts. A2:A10 Account Code (format ### or ###/###) B2:B10 Account Description (text) B15 - This is a manual entry tab, you enter the account number B16 = I want this cell to return the...
  17. B

    populate a range ("a3:h40") into listbox if cell in column "H" is interior.colorindex = 3.

    i want to populate information from range("A3:H40") to listbox only if Cell in Column("H") is colored red. the provided code list them all, even when a cell in column h is not red. Dim lbtarget As MSForms.ListBox Dim rngSource As Range Set rngSource = Sheet1.Range("A3:H19") Dim RNG As Range Set...
  18. D

    How can I select a Specific Cell and execute a function in another cell if it is found

    I want to be able to check (This is the first With statement) if a certain cell value ("H4" in this example) in the open worksheet (I refer to this worksheet as Sheet1 as it is Sheet1 in my workbook) where the code is being written (what is the proper naming scheme for this worksheet where the...
  19. R

    Conditional Formula: Using 'If' 'And' and 'Or' - solution will save days of work!

    Goal: IF Column E is Blank AND Column M OR Column T are <0 True= "Review" False= Blank I can write the 'if/and' but when I include the 'or' my results are meaningless.:confused: Any help appreciated, as a solution will save me days of work.
  20. E

    Help needed to correct the formula

    Hi, I am sure, that I am missing something silly which is stopping me from getting the desired result. This formula is a small part of a project that I am working on. Can someone please look at the screenshot, and tell me what I am doing wrong? Condition: If C3 = NA and D3 ="" then E3 should...

Some videos you may like

This Week's Hot Topics