Excel 2021: Formula to look for number AND decimal

BrerRabbit

Board Regular
Joined
Aug 20, 2023
Messages
84
Office Version
  1. 2021
  2. 2016
  3. 2013
Platform
  1. Windows
I'm using this formula to help me look for a value in an array based on certain criteria. It works... except that it looks for the number ONLY and not the decimal. For example it will return "8" instead of "8.4".

How do I amend this formula to help me look for the decimal as well. Note that there isn't always a decimal, it can be just the number.

The filter returns the number and the decimal.

=IFERROR(LET(x,FILTER(INDIRECT(D$2),('Garden Diary'!$D$60:$D$99=$B10),"JJJ"),LOOKUP(10^10,MID(x,MIN(FIND({1,2,3,4,5,6,7,8,9,0},x&1234567890,FIND("pH",x))),{1,2})+0)),"pH Result not recorded.")
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Since we have no idea what your data looks like, I think it would be beneficial to us if you could show us some samples of your data, representing the different scenarios, and then show us your expected output from each.
 
Upvote 0
I'm trying to retrieve the 8.5. The aforementioned formula is only giving me an 8. How do I retrieve the number and the decimal?
 

Attachments

  • Screenshot 2024-05-09 214010.png
    Screenshot 2024-05-09 214010.png
    5.9 KB · Views: 11
  • Screenshot 2024-05-09 214137.png
    Screenshot 2024-05-09 214137.png
    7.1 KB · Views: 11
Upvote 0
You only posted one example. Is every entry in this exact structure?
Does the number you want always appear at the very end of the entry?
Is the number always prefaced with pH?

All these details are very important.
 
Upvote 0
You only posted one example. Is every entry in this exact structure?
Does the number you want always appear at the very end of the entry?
Is the number always prefaced with pH?

All these details are very important.
The number is always prefaced with a pH. It can be anywhere in the text. As I said, this formula already extracts the number, just not the decimal.
 
Upvote 0
The number is always prefaced with a pH. It can be anywhere in the text. As I said, this formula already extracts the number, just not the decimal.
Never mind. I realised that I only allowed for 2 numbers. So I extended it to allow for 5.

=IFERROR(LET(x,FILTER(INDIRECT(D$2),('Garden Diary'!$D$60:$D$99=$B10),"JJJ"),LOOKUP(10^10,MID(x,MIN(FIND({1,2,3,4,5,6,7,8,9,0},x&1234567890,FIND("pH",x))),{1,2})+0))
is supposed to be:
=IFERROR(LET(x,FILTER(INDIRECT(D$2),('Garden Diary'!$D$60:$D$99=$B10),"JJJ"),LOOKUP(10^10,MID(x,MIN(FIND({1,2,3,4,5,6,7,8,9,0},x&1234567890,FIND("pH",x))),{1,2,3,4,5})+0)).
 
Upvote 0
Solution

Forum statistics

Threads
1,223,893
Messages
6,175,239
Members
452,621
Latest member
Laura_PinksBTHFT

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