Formula for following command in Numbers.

I want to make a formula which does that. IF D5="1h" then Print "₹500" else if D5="1h 30m" then Print=

"₹750" else if D5="2h" then Print="₹1000". Please help basically I'm keeping a record of classes and their amount, that if the duration of the class is 1hr print ₹500 and so on..


Please help me :) thanks a lott.!

MacBook Pro 13″, macOS 13.4

Posted on Jul 21, 2023 9:13 PM

Reply
2 replies

Jul 22, 2023 11:37 AM in response to arnavsachdeva

You can try something like this:





In B2 of the example, filled down:


=SWITCH(A2,DURATION(,,1),500,DURATION(,,1,30),750,DURATION(,,2),1000)


More on the SWITCH function here:


SWITCH - Apple Support


It's very simple to use, just a series of switch-value, if-match pairs.


More on the DURATION function here:


DURATION - Apple Support


Duration is specific to numbers.


I formatted the currency by selecting the cells in column B and choosing from the Data Format dropdown in the Cell tab in the pane at the right.


SG



Formula for following command in Numbers.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.