I need a Logic Statement GURU

NOVUS2017

New Member
Joined
Feb 8, 2017
Messages
6
I am exporting a report that is giving me time in a sales funnel for each lead. Unfortunately, it spits out this data in one of three forms: X Minutes, X Hours, or X Days.

I want to write a logic statement that says, If the cell end in "Days", multiply the number the cell starts with by 24. If the cell ends in "Hours" multiply the number the cell starts with by 1. If the cell ends in "Minutes", divide the number the cell starts with by 60.

Anyone have any thoughts?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Welcome to the Board!

For a value in cell A1, try this:
Code:
=LEFT(A1,FIND(" ",A1)-1) * IF(RIGHT(A1,3)="ays",24,IF(RIGHT(A1,3)="tes",1/60,1))
 
Upvote 0
My mind is blown. I am in awe. Insert gif of crowds bowing before the king. You are impressive, sir.

Welcome to the Board!

For a value in cell A1, try this:
Code:
=LEFT(A1,FIND(" ",A1)-1) * IF(RIGHT(A1,3)="ays",24,IF(RIGHT(A1,3)="tes",1/60,1))
 
Upvote 0
Glad I could help!

If you have any questions about any part of it, please let me know.
 
Upvote 0
Formula worked great, but now I'm having a secondary issue. I copied and pasted the formula down the columns for the 1800 rows I have, with my goal being to average them at the bottom. However, many of the cells are blank (being they've spent no time in that category of the sales funnel) so when I pasted in the formula it obviously resulted in the #VALUE! error. Which means I can no longer average the column. I tried just finding and deleting all cells with #VALUE!, the the find function only searches for actual cell contents.

W5Abw7i.png


Any solutions for this?
 
Upvote 0
This version should ignore blank cells:
Code:
=IF(A1<>"",LEFT(A1,FIND(" ",A1)-1) * IF(RIGHT(A1,3)="ays",24,IF(RIGHT(A1,3)="tes",1/60,1)),"")
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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
Back
Top