I don't see any reason to avoid WorksheetFunction; I don't see any confusion here.
Number_of_layers = WorksheetFunction.RoundUp(iQty / iLayerQty, 0)
You could also roll your own function:
Function RoundUp(ByVal Value As Double)
If Int(Value) = Value Then
RoundUp = Value
Else
RoundUp = Int(Value) + 1
End If
End Function
Call it like this:
Number_of_layers = RoundUp(iQty / iLayerQty)
Answer from D_Bester on Stack OverflowMicrosoft Learn
learn.microsoft.com › en-us › office › vba › api › excel.worksheetfunction.ceiling
WorksheetFunction.Ceiling method (Excel) | Microsoft Learn
This function is still available ... of Excel. However, if backward compatibility is not required, you should consider using the new functions from now on, because they more accurately describe their functionality. For more information about the new function, see the Ceiling_Precise ...
Automate Excel
automateexcel.com › home › ceiling function – round to multiple in excel, vba, g sheets
CEILING Function - Round to Multiple in Excel, VBA, G Sheets
November 7, 2023 - Range("C2") = Application.WorksheetFunction.Ceiling(Range("A2"), Range("B2")) Range("C3") = Application.WorksheetFunction.Ceiling(Range("A3"), Range("B3")) Range("C4") = Application.WorksheetFunction.Ceiling(Range("A4"), Range("B4")) Range("C5") = Application.WorksheetFunction.Ceiling(Range("A5"), Range("B5")) Range("C6") = Application.WorksheetFunction.Ceiling(Range("A6"), Range("B6")) Range("C7") = Application.WorksheetFunction.Ceiling(Range("A7"), Range("B7")) Range("C8") = Application.WorksheetFunction.Ceiling(Range("A8"), Range("B8")) Range("C9") = Application.WorksheetFunction.Ceiling(Range("A9"), Range("B9")) ... For the function arguments (number, etc.), you can either enter them directly into the function, or define variables to use instead. ... Practice Excel functions and formulas with our 100% free practice worksheets!
Videos
02:47
CEILING Function for Rounding Numbers in Excel - YouTube
10:02
Ceiling Function in Microsoft Excel - YouTube
02:04
CEILING and FLOOR Excel Functions (with examples) - YouTube
04:44
Excel MRound Function, Ceiling Function and FLOOR Function: Excel ...
02:59
How to use the CEILING Function in Excel :Tutorial - YouTube
03:22
How to use the Ceiling Function in Excel - YouTube
Top answer 1 of 5
20
I don't see any reason to avoid WorksheetFunction; I don't see any confusion here.
Number_of_layers = WorksheetFunction.RoundUp(iQty / iLayerQty, 0)
You could also roll your own function:
Function RoundUp(ByVal Value As Double)
If Int(Value) = Value Then
RoundUp = Value
Else
RoundUp = Int(Value) + 1
End If
End Function
Call it like this:
Number_of_layers = RoundUp(iQty / iLayerQty)
2 of 5
13
I use -int(-x) to get the ceiling.
?-int(-1.1) ' get ceil(1.1)
2
?-int(1.1) ' get ceil(-1.1)
-1
?-int(-5) ' get ceil(5)
5
Microsoft Learn
learn.microsoft.com › en-us › office › vba › api › excel.worksheetfunction.ceiling_precise
WorksheetFunction.Ceiling_Precise method (Excel) | Microsoft Learn
September 12, 2021 - For example, if you want to avoid using pennies in your prices and your product is priced at $4.42, use the formula Ceiling(4.42,0.05) to round prices up to the nearest nickel.
Eileen's Lounge
eileenslounge.com › viewtopic.php
VBA Floor and Ceiling Functions - Eileen's Lounge
Just discovered that vba doesn't have floor or Ceil (Ceiling) functions. How can I make sure that a result with a remainder is rounded up to the next highest number?
Microsoft Support
support.microsoft.com › en-us › office › ceiling-function-0a5cd7c8-0720-4f0a-bd2c-c943e510899f
CEILING function - Microsoft Support
Returns number rounded up, away from zero, to the nearest multiple of significance. For example, if you want to avoid using pennies in your prices and your product is priced at $4.42, use the formula =CEILING(4.42,0.05) to round prices up to the nearest nickel.
TechOnTheNet
techonthenet.com › excel › formulas › ceiling.php
MS Excel: How to use the CEILING Function (WS)
This Excel tutorial explains how to use the Excel CEILING function with syntax and examples. The Microsoft Excel CEILING function returns a number rounded up based on a multiple of significance.
IQCode
iqcode.com › code › vb › excel-vba-ceiling-function
excel vba ceiling function Code Example
October 20, 2021 - The most 'performant way to accomplish this in VBA is with this custom 'function: Function Ceil&(n#) Ceil = -Int(-n) If n < 0 Then Ceil = Fix(n) End Function '--------------------------------------------------------------------- MsgBox Ceil(5.000000000000001) '<--displays: 6 MsgBox Ceil(5.999999999999999) '<--displays: 6 MsgBox Ceil(5.000000000000000) '<--displays: 5 'Note: This method is much faster than using the RoundUp() function. ... Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond. Sign up · Develop soft skills on BrainApps Complete the IQ Test ... excel vba ceiling vba function.ceiling vba round up vba ceiling ceiling vba vba ceil vba number ceiling vba Ceil function excel-vba Ceil function excelvba Ceil function excel vba ceil function vba ceiling function excel-vba ceiling function excel vba ceiling function
Microsoft Learn
learn.microsoft.com › en-us › office › vba › api › Excel.worksheetfunction.ceiling_math
WorksheetFunction.Ceiling_Math method (Excel) | Microsoft Learn
August 14, 2006 - Office VBA reference topic
MrExcel
mrexcel.com › forums › question forums › excel questions
Ceiling using VBA code | MrExcel Message Board
September 8, 2020 - I need to add a vba code for ceiling along with vlookup worksheet function. Can anyone please help? This is my code line: Worksheets("sheets").Cells(i, 24).Value = Worksheets("sheets").Cells(i, 21).Value / Application.WorksheetFunction.VLookup(Worksheets("sheets").Cells(i, 18).Value...
FasterCapital
fastercapital.com › content › VBA-Ceiling--Reaching-New-Heights--Understanding-the-VBA-Ceiling-Method-in-Data-Analysis.html
VBA Ceiling: Reaching New Heights: Understanding the VBA Ceiling Method in Data Analysis - FasterCapital
It enables the creation of user-defined functions (UDFs) that can perform calculations not available in Excel's predefined function list. For instance, a data analyst might use VBA to write a function that calculates the Ceiling of a set of numbers based on a variable significance level, which can be particularly useful in financial analysis for rounding up to the nearest specified value.
Top answer 1 of 5
22
Since Int() seems to work like Floor(), you can get Ceiling like this: -Int(-x)
2 of 5
9
This answer uses VBA for Access, and is derived from http://www.tek-tips.com/faqs.cfm?fid=5031:
Public Function Ceiling(ByVal X As Double, Optional ByVal Factor As Double = 1) As Double
' X is the value you want to round
' Factor is the optional multiple to which you want to round, defaulting to 1
Ceiling = (Int(X / Factor) - (X / Factor - Int(X / Factor) > 0)) * Factor
End Function
Note that this answer is mathematically correct for negative X. See http://en.wikipedia.org/wiki/Floor_and_ceiling_functions#Spreadsheet_software for background.
Better Solutions
bettersolutions.com › excel › functions › ceiling-math-function.htm
Excel CEILING.MATH Function - BetterSolutions.com
February 16, 2026 - Microsoft Excel · Functions · CEILING.MATH · Maths & Trigonometry · Complete List · Alphabetical - C · Index - C · Updated: 01 March 2026 · 01 March 2026 · © 2026 Better Solutions Limited. All Rights Reserved.
Get-digital-help
get-digital-help.com › how-to-use-the-ceiling-function
How to use the CEILING function
Excel Basics Excel Defined Table Advanced Filter Data Validation Drop-down lists Named Ranges Solver ... VBA Functions Methods Properties Statements Macros User defined functions Files & folders Checkboxes ... The CEILING function rounds a number up to its nearest multiple.
Ajelix
ajelix.com › home › resources › formulas and functions › ceiling function ms excel
How To Use CEILING Function in Excel Guide With Examples - Ajelix
March 14, 2024 - Excel VBA Code Debugger · Google ... · A CEILING function in Excel is a mathematical function that rounds a number up to the nearest integer, or to the nearest multiple of a specified value....
ExcelDemy
exceldemy.com › home › excel functions › how to use ceiling function in excel (with 3 examples)
How to Use CEILING Function in Excel (With 3 Examples) - ExcelDemy
July 23, 2024 - By default, the CEILING function rounds up numbers by adjusting them away from zero (0). ... Mrinmoy Roy, a dedicated professional with a BSc in Electronics and Communication Engineering from Khulna University of Engineering & Technology, Bangladesh, brings over two years of expertise to the ExcelDemy project. As a prolific contributor, he has authored around 180 articles, showcasing his deep knowledge and passion for Microsoft Excel, Data Analysis, and VBA...