if then else

  1. J

    vlookup, if then else, etc

    https://drive.google.com/file/d/1ly_TVkX804dgmNfMscyBRXCAs3vtx-jp/view?usp=sharing I have built a sheet that helps me manage my inventory. I have a BIN REPORT and REC INPUT tab where i update information which then feeds to my CONSOLIDATION tab which helps me minimize warehouse space. I even...
  2. B

    If Then using Length

    Hi Power Users! I am very new to Power Query, but an advanced Excel user. I am starting to get into Power Query and using data tables across a number of workbooks. I have a column in my data table that should be a number however, sometimes it will be a text due to a letter being added to the...
  3. L

    Searching for text string using If function.

    I have macro in VBA that uses a data set in excel. Then it filters all but one specific vendor. Everyone else is removed from that data set. Unfilter. Then I'm left with headers only and no data lines (line 2 and below) or I'm left with header data and data in lines 2 and usually more. Then...
  4. C

    if the else

    <colgroup><col style="mso-width-source:userset;mso-width-alt:9325;width:191pt" width="255"> <col style="mso-width-source:userset;mso-width-alt:2157;width:44pt" width="59"> <col style="mso-width-source:userset;mso-width-alt:10532;width:216pt" width="288"> </colgroup><tbody> SHELBERT...
  5. R

    Restricting TextBox Numeric Range

    Hi Everyone, I have TextBox1 in a userform. When somebody opens up the userform the textbox is prepopulated with a number already in it (.31), however I did leave the option for the user to change this number if needed. The reason why there's a decimal because when the number is submitted on...
  6. J

    Automatically update formula using reference to sheet not present

    Hello, I would like to firstly check if a specific sheet exists, then if TRUE, extract a value from that sheet. I do this in two stages: Step1:- Cell B3 - If sheet "JAN2018" exist, then return 0, else FALSE - =IFERROR(INDIRECT("JAN2018"&"!A1"),"FALSE") Step 2:- Cell B5 - If cell B3 = 0...
  7. S

    VBA Macro: If Begins With Then

    I am failing dramatically at writing the code for this, what I thought would be a simple macro. This initial process is the following: IF E2 begins with “006***” THEN return the last 8 characters in the string in U2, only IF the final 8 characters are numbers, THEN return “N/A” in U2, & IF...
  8. J

    How to clear drop down list contents based on contents of another cell

    Hello I am using open office calc (apache) and in my document I have a number of dropdown lists e.g dropdown list 1 has the following entries: Not Selected Yes No In another worksheet of the same document I ask various questions (say to some sales people) e.g (in cell A6): Q1) Would you like...
  9. F

    if column does not contain value then do not create pivot table

    Hello dear Excel users, I wrote a macro that is creating 3 pivot tables, all in separate sheets, from the same table (table1) in the sheet RAWDATA. The last pivot table must be created only when at least 1 row in table1 in column K is containing the word TRUCK. If no rows exist with the word...
  10. K

    Formating cell color based on cell color

    I am trying to conditionally format a cell based on other conditional formatting in a range of cells. Ex. I would like cell E3 to be: Red if any cells (O3, T3, Y3, AD3, AI3, AN3, AS3) are Red IF NOT THEN Yellow if any cells (O3, T3, Y3, AD3, AI3, AN3, AS3) are Yellow IF NOT THEN Green if any...
  11. T

    if text and if number in a cell then.. Please help.

    Hi all. I have a dilemma I hope you can help me with. I am not great at VBA so bare with me. I need a macro that will look in an individual cell and work out what to do with its contents. There could be a number, or a text and a number. the column is essentially serial numbers. for eg. item 123...
  12. H

    If Statement Not Firing Properly

    Hi all, I am trying to correct an error on many spreadsheets (100+) we have located out on a network drive. I had a formula that was incorrectly written and needs to be updated. I've written the code below to be used in a loop macro that opens up each spreadsheet and updates the formulas (if...
  13. B

    IF statement involving string function

    Hi, Please help or advise. I am trying to write an IF statement that allow me to autofilter my data list. My code is to use string function to detect a certain text in a cell (D3), so basically if D3 contains "77" then filter with a condition, else filter with another condition. Below is how my...
  14. C

    Using If Then Else for Email Attachments

    Hey Everyone, I'm brand new to VBA, and I think I've exhausted my efforts in trying to figure out my problem. Our VBA expert left the company, and I was tasked with optimizing a tool that he created which we use to send email correspondences to candidates. The code works as is, but my manager...
  15. D

    How To Do An If Then Statement :: Message Box Otherwise Execute Code

    I would like to run the below code only when there is no "x"'s in the following ranges: ActiveSheet.Range("C16:C633") Sub msgReset() Dim iRet As Integer Dim strPrompt As String Dim strTitle As String Dim num As Integer Dim var2 As String var2 = "x"...
  16. D

    If Then Statement to Apply Code for TextBox

    I would like to apply the following code (only if the shape is not already placed in the location): Private Sub Workbook_BeforeClose(Cancel As Boolean) Sheets("Pricing").Shapes.AddTextBox(msoTextOrientationHorizontal, 807.3529133858, _ 5.2940944882, 632.6470866142...
  17. R

    If then else statement

    Hi I am relatively new to VBA with basic knowledge and need help writing a macro.. I have text in column V of my worksheet, the value of cells in column V is either "Clear", "Pending" or blank "". I want to write a macro that will input the date the current date into columns U and W IF the...
  18. R

    Help with IF function

    I need cell V3 to populate with a percentage that corresponds with a range of cells (AC7:AF9 shown below) based on a couple of variables (their age, whether they are male or female). basically it should be like this... Cell V3 (A Soldiers Allowed BF%) will automatically populate from a range...
  19. S

    Declaring dynamic variable using if then

    Hello, I have a problem with declaring a variable which I want to use later in my macro. The problem is that I need to first "calculate" this variable which is dependent on the file name. I used "if then else" statement to pull out from the file name one thing that changes - week number. The...
  20. S

    Need to correct this formula

    I need to modify a complex array formula. Here's the logic.... 1st condition: if the value in column A matches with the value of column A in previous row; Condition passes.... Then check if the value in Column E has occurred for the 1st time for similar value of column A Condition...
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

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