if statement

  1. L

    For Each worksheet with If statement

    Good Day, I have read through so many posts and I'm not finding the issue that I'm struggling to solve. I am trying to include logic where my macro will stop if there is any missing data... The user, prior to running the macro, needs to move a sheet into the macro-enabled template. The sheet...
  2. M

    Vlookup to return date from data sheet if between certain date range.

    Hello all, I have a two sheet workspace. Sheet 1 is called Data and sheet 2 is Print Dates. In Sheet 1 I have in multiple columns three sites. Site 1, 2 and 3. Site reference is found in row 3. Columns A4:A80 are dates for Site 1, Columns C4:C80 are dates for Site 2 and Columns E4:E80 are...
  3. M

    Array Formula Extract Records tutorial not working for me

    Having watched a MrExcel YouTube video about pulling records based on a condition, I attempted to reorganise a large question bank we have for learners. Unfortunately, the formula doesn't seem to work as it's getting caught pulling correct row numbers and always returns 0...
  4. E

    Sum Cells and IF Statement to add times

    I have a table where I record the start time and end time for Frac and Wireline operations on a well, and that process is repeated for each stage of the well. Sometimes we skip stages and no times are entered indicating that skip which messed up the Total Time calculation. I left "Stage 3" (Row...
  5. A

    VBA doesn't remove all the rows

    Hello all, I have this code that does what it's supposed to, but it requires me to run the code several times, I am just trying to see what I can improve upon to make this code run completely the first time. Sub deleteNonBank() Dim R As Long Dim Lastrow As Long Lastrow =...
  6. F

    Shortening Long Nested Formula

    Looking for a possibility of making this formula shorter, any ideas? Thanks =IF(AND(INDEX('Tab2'!$F:$M,MATCH($F$3,'Tab2'!$J:$J,0),7)=0,INDEX('Tab2'!$F:$M,MATCH($F$3,'Tab2'!$J:$J,0),8)>0),INDEX('Tab2'!$F:$M,MATCH($F$3,'Tab2'!$J:$J,0),1),"") This formula is producing this The active cell is A6...
  7. S

    =IF statement assistance

    Hi, I am hoping you could assist me with a formula I need. K2 has a drop down list with the following options; 12 month nomination or 2 year review. K36 needs to be able to calculated based on the option selected above. e.g if 12 month nomination is selected then K36 needs to divide K35 by...
  8. B

    IF statement with concatenate to show resubmitted work

    Hi Everyone, I'm trying to figure out a formula to show if a request was rejected or approved. We make trackers twice a day and the only way to notice if a request is rejected, is if it shows up twice but with a different date. Providing example 135969 HIERARCHY HIERARCHY ARTICLE_CHANGE...
  9. R

    Cut/copy and Paste data to another sheet if only one conidtion is met

    Hello, I am new to this so please excuse my ignroance... this is my first post... I just have a question I want to create a macro that cuts data from a certain range in one sheet and then pastes that data into another sheet if one condition is met. So I have attached this spreadsheet as an...
  10. D

    Conditional formula help

    Hello, I can't figure our correct formula for this problem: The primary key has multiple costs, that are displayed in columns "Item1, Item2 and etc." I want to assign VAR that multiplies primary key sales amount with either Item1, Item2 cost The condition should check each Item column and...
  11. A

    Help for Nested Conditionals (IF/AND/OR/SUMIF etc.)

    Hello and Good Day! I have an issue with writing a proper conditional formula in Excel, so please help me Elaborating my issue, Column A are Fruits; They either have "Oranges", "Apples", or "Pears" Column B are Client's Names I'll input the gross income on C Result for net income will be...
  12. 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...
  13. 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...
  14. 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...
  15. 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...
  16. 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...
  17. 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...
  18. 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...
  19. 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...
  20. 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...

Watch MrExcel Video

This Week's Hot Topics

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back